-
Notifications
You must be signed in to change notification settings - Fork 116
Closed
Labels
runtime semanticsAccurate modeling of how Python's semantics work at runtimeAccurate modeling of how Python's semantics work at runtime
Milestone
Description
Doc: https://docs.python.org/3/library/enum.html
Typing spec: https://typing.python.org/en/latest/spec/enums.html
Base features:
- Differentiating members from non-members
- Create a new type variant for enum literals
- Enum literal expansion
- Write a micro benchmark with large enums
- Enforce implicit
@final
for Enum classes (with members) - Support iteration over enums
- Detect enums in all cases (metaclass derives from
EnumMeta
/EnumType
)
Advanced features:
- Infer type for member names and member values.
- Handling of
enum.Flag
(enum expansion may not be performed for subclasses ofenum.Flag
) - Special-case handling of
IntEnum
,StrEnum
, or other custom classes that derive from bothEnum
and some other class (infer appropriate types for member values) - Custom
__new__
or__init__
methods in enums. -
auto()
values - Support for generate_next_value
- Special-case handling for call to enum class to retrieve member by value (e.g. Color(“red”))
- Function syntax to create Enums
edgarrmondragon, Avasam, joanise, DetachHead, scosman and 2 more
Metadata
Metadata
Assignees
Labels
runtime semanticsAccurate modeling of how Python's semantics work at runtimeAccurate modeling of how Python's semantics work at runtime