Add EnumType to enum.pyi on Python 3.11 (#6568)

This commit is contained in:
Nikita Sobolev
2021-12-11 20:13:32 +03:00
committed by GitHub
parent f9cedff5af
commit b1f0271da6

View File

@@ -24,6 +24,10 @@ class EnumMeta(ABCMeta):
_member_map_: dict[str, Enum] # undocumented
_value2member_map_: dict[Any, Enum] # undocumented
if sys.version_info >= (3, 11):
# In 3.11 `EnumMeta` metaclass is renamed to `EnumType`, but old name also exists.
EnumType = EnumMeta
class Enum(metaclass=EnumMeta):
name: str
value: Any