diff --git a/stdlib/2/__builtin__.pyi b/stdlib/2/__builtin__.pyi index d0e3ef6b0cb5..4378fdf39192 100644 --- a/stdlib/2/__builtin__.pyi +++ b/stdlib/2/__builtin__.pyi @@ -725,7 +725,7 @@ def min(iterable: Iterable[_T], key: Callable[[_T], Any] = ...) -> _T: ... @overload def next(i: Iterator[_T]) -> _T: ... @overload -def next(i: Iterator[_T], default: _T) -> _T: ... +def next(i: Iterator[_T], default: _VT) -> Union[_T, _VT]: ... def oct(i: int) -> str: ... # TODO __index__ @overload def open(file: str, mode: str = 'r', buffering: int = ...) -> BinaryIO: ... diff --git a/stdlib/3/builtins.pyi b/stdlib/3/builtins.pyi index 87828bf52bf4..895ec09513e7 100644 --- a/stdlib/3/builtins.pyi +++ b/stdlib/3/builtins.pyi @@ -743,7 +743,7 @@ def min(iterable: Iterable[_T], key: Callable[[_T], Any] = ..., default: _T = .. @overload def next(i: Iterator[_T]) -> _T: ... @overload -def next(i: Iterator[_T], default: _T) -> _T: ... +def next(i: Iterator[_T], default: _VT) -> Union[_T, _VT]: ... def oct(i: int) -> str: ... # TODO __index__ if sys.version_info >= (3, 6):