diff --git a/third_party/2/enum.pyi b/third_party/2/enum.pyi index 47f89900f8a9..c0b4659418e2 100644 --- a/third_party/2/enum.pyi +++ b/third_party/2/enum.pyi @@ -1,7 +1,11 @@ -from typing import List, Any, TypeVar, Type +from typing import List, Any, TypeVar, Type, Iterable, Iterator -class Enum: - def __new__(cls, value: Any) -> None: ... +_T = TypeVar('_T', bound=Enum) +class EnumMeta(type, Iterable[Enum]): + def __iter__(self: Type[_T]) -> Iterator[_T]: ... # type: ignore + +class Enum(metaclass=EnumMeta): + def __new__(cls: Type[_T], value: Any) -> _T: ... def __repr__(self) -> str: ... def __str__(self) -> str: ... def __dir__(self) -> List[str]: ... @@ -12,8 +16,6 @@ class Enum: name = ... # type: str value = ... # type: Any -_T = TypeVar('_T') - class IntEnum(int, Enum): # type: ignore def __new__(cls: Type[_T], value: Any) -> _T: ...