Skip to content

Commit

Permalink
Use a separate type variable for unique() (#1138)
Browse files Browse the repository at this point in the history
* Use a separate type variable for unique()

See #1136 (comment)

* actually use the new typevar
  • Loading branch information
gvanrossum authored and JelleZijlstra committed Apr 5, 2017
1 parent 47c325c commit f44e461
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion stdlib/3.4/enum.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import sys
from typing import List, Any, TypeVar, Union, Iterable, Iterator, TypeVar, Generic, Type

_T = TypeVar('_T', bound=Enum)
_S = TypeVar('_S', bound=Type[Enum])

class EnumMeta(type, Iterable[Enum]):
def __iter__(self: Type[_T]) -> Iterator[_T]: ... # type: ignore
Expand All @@ -21,7 +22,7 @@ class Enum(metaclass=EnumMeta):
class IntEnum(int, Enum):
value = ... # type: int

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

if sys.version_info >= (3, 6):
_auto_null = ... # type: Any
Expand Down

0 comments on commit f44e461

Please sign in to comment.