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

This commit is contained in:
Nikita Sobolev authored and GitHub committed 2021-12-11 19:13:32 +02:00
1 parent f9cedff5af
commit b1f0271da6
1 file changed
+4
+4
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