diff --git a/stdlib/builtins.pyi b/stdlib/builtins.pyi index 44e76da31b6d..9c5685440f0e 100644 --- a/stdlib/builtins.pyi +++ b/stdlib/builtins.pyi @@ -1087,9 +1087,7 @@ def input(__prompt: object = ...) -> str: ... @overload def iter(__iterable: Iterable[_T]) -> Iterator[_T]: ... @overload -def iter(__function: Callable[[], _T | None], __sentinel: None) -> Iterator[_T]: ... -@overload -def iter(__function: Callable[[], _T], __sentinel: object) -> Iterator[_T]: ... +def iter(__function: Callable[[], _T | _S], __sentinel: _S) -> Iterator[_T]: ... # We need recursive types to express the type of the second argument to `isinstance` properly, hence the use of `Any` if sys.version_info >= (3, 10):