8000 builtins.pyi: Use two type vars · python/typeshed@82ee154 · GitHub
[go: up one dir, main page]

Skip to content

Commit 82ee154

Browse files
committed
builtins.pyi: Use two type vars
Fixes: #3201
1 parent c32e1e2 commit 82ee154

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

stdlib/2/__builtin__.pyi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ if sys.version_info >= (3,):
1818
from typing import SupportsBytes, SupportsRound
1919

2020
_T = TypeVar('_T')
21+
_U = TypeVar('_U')
2122
_T_co = TypeVar('_T_co', covariant=True)
2223
_KT = TypeVar('_KT')
2324
_VT = TypeVar('_VT')
@@ -1189,7 +1190,7 @@ else:
11891190
@overload
11901191
def iter(__iterable: Iterable[_T]) -> Iterator[_T]: ...
11911192
@overload
1192-
def iter(__function: Callable[[], _T], __sentinel: _T) -> Iterator[_T]: ...
1193+
def iter(__function: Callable[[], Union[_T, _U]], __sentinel: _U) -> Iterator[_T]: ...
11931194
def isinstance(__o: object, __t: Union[type, Tuple[Union[type, Tuple[Any, ...]], ...]]) -> bool: ...
11941195
def issubclass(__cls: type, __classinfo: Union[type, Tuple[Union[type, Tuple[Any, ...]], ...]]) -> bool: ...
11951196
def len(__o: Sized) -> int: ...

stdlib/2and3/builtins.pyi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ if sys.version_info >= (3,):
1818
from typing import SupportsBytes, SupportsRound
1919

2020
_T = TypeVar('_T')
21+
_U = TypeVar('_U')
2122
_T_co = TypeVar('_T_co', covariant=True)
2223
_KT = TypeVar('_KT')
2324
_VT = TypeVar('_VT')
@@ -1189,7 +1190,7 @@ else:
11891190
@overload
11901191
def iter(__iterable: Iterable[_T]) -> Iterator[_T]: ...
11911192
@overload
1192-
def iter(__function: Callable[[], _T], __sentinel: _T) -> Iterator[_T]: ...
1193+
def iter(__function: Callable[[], Union[_T, _U]], __sentinel: _U) -> Iterator[_T]: ...
11931194
def isinstance(__o: object, __t: Union[type, Tuple[Union[type, Tuple[Any, ...]], ...]]) -> bool: ...
11941195
def issubclass(__cls: type, __classinfo: Union[type, Tuple[Union[type, Tuple[Any, ...]], ...]]) -> bool: ...
11951196
def len(__o: Sized) -> int: ...

0 commit comments

Comments
 (0)
0