Skip to content

Commit

Permalink
Support enum iteration.
Browse files Browse the repository at this point in the history
  • Loading branch information
Guido van Rossum committed Feb 8, 2017
1 parent f192b8c commit bebb49a
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions stdlib/3.4/enum.pyi
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
# FIXME: Stub incomplete, ommissions include:
# * the metaclass
# * _sunder_ methods with their transformations

import abc
import sys
from typing import List, Any, TypeVar, Union
from typing import List, Any, TypeVar, Union, Iterable, Iterator, TypeVar, Generic, Type

class Enum:
def __new__(cls, value: Any) -> None: ...
_T = TypeVar('_T', bound=Enum)

class EnumMeta(abc.ABCMeta, 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]: ...
Expand All @@ -20,8 +25,6 @@ class Enum:
class IntEnum(int, Enum):
value = ... # type: int

_T = TypeVar('_T')

def unique(enumeration: _T) -> _T: ...

if sys.version_info >= (3, 6):
Expand Down

0 comments on commit bebb49a

Please sign in to comment.