Overlay for the enum standard library. For InterpreterClass enums, i.e. ones in the file being analyzed, the overlay is accessed by: 1. abstract.BuildClass sees a class with enum.Enum as its base, and calls EnumBuilder.make_class. 2. EnumBuilder.make_class does some validation, then passes along the actual creation to ctx.make_class. Notably, EnumBuilder passes in EnumInstance to ctx.make_class, which provides enum-specific behavior. 3. ctx.make_class does its usual, then calls call_metaclass_init on the newly created EnumInstance. This bounces back into the overlay, namely EnumMetaInit. 4. EnumMetaInit does the actual transformation of members into proper enum members. The transformation into an enum happens so late because enum members are instances of the enums, which is easier to accomplish when the enum class has already been created. PytdClass enums, i.e. those loaded from type stubs, enter the overlay when the pytd.Class is wrapped with an abstract.PyTDClass in convert.py. After wrapping, call_metaclass_init is called, allowing EnumMetaInit to transform the PyTDClass into a proper enum.
Class |
|
Overlays enum.Enum. |
Class |
|
Implements the functionality of __eq__ for an enum. |
Class |
|
A wrapper for classes that subclass enum.Enum. |
Class |
|
Wrapper for enum.EnumMeta. |
Class |
|
Implements the functionality of __getitem__ for enums. |
Class |
|
Implements the functionality of EnumMeta.__init__. |
Class |
|
An overlay for the enum std lib module. |
Class |
|
Overlays enum.IntEnum using EnumBuilder. |
Variable | log |
Undocumented |