mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 12:44:28 +08:00
make enums support len() (#1139)
This commit is contained in:
committed by
Guido van Rossum
parent
8510adfe05
commit
f7e4cb8c79
@@ -1,10 +1,10 @@
|
||||
import sys
|
||||
from typing import List, Any, TypeVar, Union, Iterable, Iterator, TypeVar, Generic, Type
|
||||
from typing import List, Any, TypeVar, Union, Iterable, Iterator, TypeVar, Generic, Type, Sized
|
||||
|
||||
_T = TypeVar('_T', bound=Enum)
|
||||
_S = TypeVar('_S', bound=Type[Enum])
|
||||
|
||||
class EnumMeta(type, Iterable[Enum]):
|
||||
class EnumMeta(type, Iterable[Enum], Sized):
|
||||
def __iter__(self: Type[_T]) -> Iterator[_T]: ... # type: ignore
|
||||
|
||||
class Enum(metaclass=EnumMeta):
|
||||
|
||||
Reference in New Issue
Block a user