You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
to the typing module. This allows to make some of our type hints more precise.
We should review our code bases and
use the @final decorator for classes and methods that should not be subclassed/overridden, e.g. in interface classes like Base{Persistence, Handler, UpdateProcessor, Request}
Use Final rather than ClassVar for class attributes that are not supposed to be overridden, e.g. Chat.PRIVATE. Also check if there are other attributes that should be considered final
Use Literal where it makes sense. These may be very few places, considering that it does not play well in combination with enums (Literal of enum values python/typing#781)
A PR in this direction is very welcome. As long as #3728 is open, it should be based on the drop-py-37 branch. If you would like to send a PR, please be sure to read our contribution guide and leave a short comment so that we can assign you.
The text was updated successfully, but these errors were encountered:
Python 3.8 adds the
@final
decoratorFinal
typeLiteral
typeto the
typing
module. This allows to make some of our type hints more precise.We should review our code bases and
@final
decorator for classes and methods that should not be subclassed/overridden, e.g. in interface classes likeBase{Persistence, Handler, UpdateProcessor, Request}
Final
rather thanClassVar
for class attributes that are not supposed to be overridden, e.g.Chat.PRIVATE
. Also check if there are other attributes that should be considered finalLiteral
where it makes sense. These may be very few places, considering that it does not play well in combination with enums (Literal of enum values python/typing#781)A PR in this direction is very welcome. As long as #3728 is open, it should be based on the
drop-py-37
branch. If you would like to send a PR, please be sure to read our contribution guide and leave a short comment so that we can assign you.The text was updated successfully, but these errors were encountered: