From c1e3be1248eb4a4fc1687746510fcf6ed6f9d871 Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Sat, 5 Feb 2022 05:53:29 -0800 Subject: [PATCH] zip.__iter__ and reversed.__iter__ return self (#7123) --- stdlib/builtins.pyi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stdlib/builtins.pyi b/stdlib/builtins.pyi index 3aa74fa53..e568ce6a7 100644 --- a/stdlib/builtins.pyi +++ b/stdlib/builtins.pyi @@ -1412,7 +1412,7 @@ class reversed(Iterator[_T], Generic[_T]): def __init__(self, __sequence: Reversible[_T]) -> None: ... @overload def __init__(self, __sequence: SupportsLenAndGetItem[_T]) -> None: ... - def __iter__(self) -> Iterator[_T]: ... + def __iter__(self: Self) -> Self: ... def __next__(self) -> _T: ... def repr(__obj: object) -> str: ... @@ -1524,7 +1524,7 @@ class zip(Iterator[_T_co], Generic[_T_co]): *iterables: Iterable[Any], ) -> zip[tuple[Any, ...]]: ... - def __iter__(self) -> Iterator[_T_co]: ... + def __iter__(self: Self) -> Self: ... def __next__(self) -> _T_co: ... # Signature of `builtins.__import__` should be kept identical to `importlib.__import__`