-
Notifications
You must be signed in to change notification settings - Fork 6k
Closed
Labels
⚙️ type-hintingaffected functionality: type-hintingaffected functionality: type-hinting
Description
Python 3.8 adds the
to the typing module. This allows to make some of our type hints more precise.
We should review our code bases and
- use the
@finaldecorator for classes and methods that should not be subclassed/overridden, e.g. in interface classes likeBase{Persistence, Handler, UpdateProcessor, Request} - Use
Finalrather thanClassVarfor 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
Literalwhere 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.
Metadata
Metadata
Assignees
Labels
⚙️ type-hintingaffected functionality: type-hintingaffected functionality: type-hinting