1- From 7678bc3f80e4d3f04a0ff0ee3a7d51f49ae4c465 Mon Sep 17 00:00:00 2001
1+ From 69791281c2c5e919cea9a77c4a771f79d9e70384 Mon Sep 17 00:00:00 2001
22From: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
33Date: Sat, 21 Dec 2024 22:36:38 +0100
44Subject: [PATCH] Revert Remove redundant inheritances from Iterator in
@@ -36,10 +36,10 @@ index d663f5d93..f43178e4d 100644
3636 @property
3737 def _exception(self) -> BaseException | None: ...
3838diff --git a/mypy/typeshed/stdlib/builtins.pyi b/mypy/typeshed/stdlib/builtins.pyi
39- index 044e264d2..6d813f172 100644
39+ index 8acdeadff..5a3bb5908 100644
4040--- a/mypy/typeshed/stdlib/builtins.pyi
4141+++ b/mypy/typeshed/stdlib/builtins.pyi
42- @@ -1210 ,7 +1210 ,7 @@ class frozenset(AbstractSet[_T_co]):
42+ @@ -1226 ,7 +1226 ,7 @@ class frozenset(AbstractSet[_T_co]):
4343 def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...
4444
4545 @disjoint_base
@@ -48,7 +48,7 @@ index 044e264d2..6d813f172 100644
4848 def __new__(cls, iterable: Iterable[_T], start: int = 0) -> Self: ...
4949 def __iter__(self) -> Self: ...
5050 def __next__(self) -> tuple[int, _T]: ...
51- @@ -1404 ,7 +1404 ,7 @@ else:
51+ @@ -1413 ,7 +1413 ,7 @@ else:
5252 exit: _sitebuiltins.Quitter
5353
5454 @disjoint_base
@@ -57,7 +57,7 @@ index 044e264d2..6d813f172 100644
5757 @overload
5858 def __new__(cls, function: None, iterable: Iterable[_T | None], /) -> Self: ...
5959 @overload
60- @@ -1468 ,7 +1468 ,7 @@ license: _sitebuiltins._Printer
60+ @@ -1477 ,7 +1477 ,7 @@ license: _sitebuiltins._Printer
6161
6262 def locals() -> dict[str, Any]: ...
6363 @disjoint_base
@@ -66,7 +66,7 @@ index 044e264d2..6d813f172 100644
6666 # 3.14 adds `strict` argument.
6767 if sys.version_info >= (3, 14):
6868 @overload
69- @@ -1775 ,7 +1775 ,7 @@ def pow(base: _SupportsSomeKindOfPow, exp: complex, mod: None = None) -> complex
69+ @@ -1784 ,7 +1784 ,7 @@ def pow(base: _SupportsSomeKindOfPow, exp: complex, mod: None = None) -> complex
7070 quit: _sitebuiltins.Quitter
7171
7272 @disjoint_base
@@ -75,7 +75,7 @@ index 044e264d2..6d813f172 100644
7575 @overload
7676 def __new__(cls, sequence: Reversible[_T], /) -> Iterator[_T]: ... # type: ignore[misc]
7777 @overload
78- @@ -1839 ,7 +1839 ,7 @@ def vars(object: type, /) -> types.MappingProxyType[str, Any]: ...
78+ @@ -1848 ,7 +1848 ,7 @@ def vars(object: type, /) -> types.MappingProxyType[str, Any]: ...
7979 @overload
8080 def vars(object: Any = ..., /) -> dict[str, Any]: ...
8181 @disjoint_base
@@ -107,7 +107,7 @@ index 2c8e7109c..4ed0ab1d8 100644
107107 restkey: _T | None
108108 restval: str | Any | None
109109diff --git a/mypy/typeshed/stdlib/fileinput.pyi b/mypy/typeshed/stdlib/fileinput.pyi
110- index 910d63814..eb942bc55 100644
110+ index 6778b7648..95164de2f 100644
111111--- a/mypy/typeshed/stdlib/fileinput.pyi
112112+++ b/mypy/typeshed/stdlib/fileinput.pyi
113113@@ -1,8 +1,8 @@
@@ -118,7 +118,7 @@ index 910d63814..eb942bc55 100644
118118 from types import GenericAlias, TracebackType
119119- from typing import IO, Any, AnyStr, Generic, Literal, Protocol, overload, type_check_only
120120+ from typing import IO, Any, AnyStr, Literal, Protocol, overload, type_check_only
121- from typing_extensions import Self, TypeAlias
121+ from typing_extensions import Self, TypeAlias, deprecated
122122
123123 __all__ = [
124124@@ -105,7 +105,7 @@ def fileno() -> int: ...
@@ -131,7 +131,7 @@ index 910d63814..eb942bc55 100644
131131 # encoding and errors are added
132132 @overload
133133diff --git a/mypy/typeshed/stdlib/itertools.pyi b/mypy/typeshed/stdlib/itertools.pyi
134- index fe4ccbdf8..73745fe92 100644
134+ index 8a924ad8b..5c2bf7f83 100644
135135--- a/mypy/typeshed/stdlib/itertools.pyi
136136+++ b/mypy/typeshed/stdlib/itertools.pyi
137137@@ -28,7 +28,7 @@ _Predicate: TypeAlias = Callable[[_T], object]
@@ -166,7 +166,7 @@ index fe4ccbdf8..73745fe92 100644
166166- class accumulate(Generic[_T]):
167167+ class accumulate(Iterator[_T]):
168168 @overload
169- def __new__(cls, iterable: Iterable[_T], func: None = None, *, initial: _T | None = ... ) -> Self: ...
169+ def __new__(cls, iterable: Iterable[_T], func: None = None, *, initial: _T | None = None ) -> Self: ...
170170 @overload
171171@@ -64,7 +64,7 @@ class accumulate(Generic[_T]):
172172 def __next__(self) -> _T: ...
@@ -239,7 +239,7 @@ index fe4ccbdf8..73745fe92 100644
239239+ class zip_longest(Iterator[_T_co]):
240240 # one iterable (fillvalue doesn't matter)
241241 @overload
242- def __new__(cls, iter1: Iterable[_T1], /, *, fillvalue: object = ... ) -> zip_longest[tuple[_T1]]: ...
242+ def __new__(cls, iter1: Iterable[_T1], /, *, fillvalue: object = None ) -> zip_longest[tuple[_T1]]: ...
243243@@ -202,7 +202,7 @@ class zip_longest(Generic[_T_co]):
244244 def __next__(self) -> _T_co: ...
245245
@@ -291,8 +291,8 @@ index fe4ccbdf8..73745fe92 100644
291291- class batched(Generic[_T_co]):
292292+ class batched(Iterator[tuple[_T_co, ...]], Generic[_T_co]):
293293 if sys.version_info >= (3, 13):
294- def __new__(cls, iterable: Iterable[_T_co], n: int, *, strict: bool = False) -> Self: ...
295- else:
294+ @overload
295+ def __new__(cls, iterable: Iterable[_T], n: Literal[1], *, strict: Literal[True]) -> batched[tuple[_T]]: ...
296296diff --git a/mypy/typeshed/stdlib/multiprocessing/pool.pyi b/mypy/typeshed/stdlib/multiprocessing/pool.pyi
297297index b79f9e773..f276372d0 100644
298298--- a/mypy/typeshed/stdlib/multiprocessing/pool.pyi
@@ -313,10 +313,10 @@ index b79f9e773..f276372d0 100644
313313 def __iter__(self) -> Self: ...
314314 def next(self, timeout: float | None = None) -> _T: ...
315315diff --git a/mypy/typeshed/stdlib/sqlite3/__init__.pyi b/mypy/typeshed/stdlib/sqlite3/__init__.pyi
316- index 6b0f1ba94..882cd143c 100644
316+ index 04b978b1b..e4604144f 100644
317317--- a/mypy/typeshed/stdlib/sqlite3/__init__.pyi
318318+++ b/mypy/typeshed/stdlib/sqlite3/__init__.pyi
319- @@ -407 ,7 +407 ,7 @@ class Connection:
319+ @@ -408 ,7 +408 ,7 @@ class Connection:
320320 ) -> Literal[False]: ...
321321
322322 @disjoint_base
@@ -326,5 +326,5 @@ index 6b0f1ba94..882cd143c 100644
326326 @property
327327 def connection(self) -> Connection: ...
328328- -
329- 2.51.1
329+ 2.52.0
330330
0 commit comments