-
Suggestion
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
6.8, 6.9
-
None
Since ~January 2024, it is part of the typing spec that Enums in stubs can specify their exact values and type-checkers can use those.
The related spec section:[ https://typing.python.org/en/latest/spec/enums.html#defining-members|https://typing.python.org/en/latest/spec/enums.html#defining-members]
Refs for when this was added:
- https://discuss.python.org/t/draft-of-typing-spec-chapter-for-enums/43496
- https://github.com/python/typing-council/issues/11
- https://github.com/python/typing/pull/1759
So instead of
You can now have