Skip to content

Commit f44e461

Browse files
gvanrossumJelleZijlstra
authored andcommitted
Use a separate type variable for unique() (#1138)
* Use a separate type variable for unique() See #1136 (comment) * actually use the new typevar
1 parent 47c325c commit f44e461

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

stdlib/3.4/enum.pyi

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import sys
22
from typing import List, Any, TypeVar, Union, Iterable, Iterator, TypeVar, Generic, Type
33

44
_T = TypeVar('_T', bound=Enum)
5+
_S = TypeVar('_S', bound=Type[Enum])
56

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

24-
def unique(enumeration: _T) -> _T: ...
25+
def unique(enumeration: _S) -> _S: ...
2526

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

0 commit comments

Comments
 (0)