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 Apr 4, 2017
1 parent 3594b0e commit 78d9f8e
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions stdlib/3.4/enum.pyi
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
# 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

_T = TypeVar('_T', bound=Enum)

class Enum:
def __new__(cls, value: Any) -> None: ...
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 +22,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 78d9f8e

Please sign in to comment.