-
Suggestion
-
Resolution: Fixed
-
P3: Somewhat important
-
6.8, 6.9
-
None
-
45b9a7de8 (dev), 0a0b59d82 (6.9), 822397986 (tqtc/lts-6.8), 9036d8c2d (tqtc/dev), 436bc5e3c (tqtc/6.10), dd9ac00b8 (tqtc/6.9), 1703555f0 (tqtc/6.8)
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