1
- From 25250cbe1f7ee0e924ac03b3f19297e1885dd13e Mon Sep 17 00:00:00 2001
1
+ From abc5225e3c69d7ae8f3388c87260fe496efaecac Mon Sep 17 00:00:00 2001
2
2
From: Marc Mueller <
[email protected] >
3
3
Date: Sat, 21 Dec 2024 22:36:38 +0100
4
4
Subject: [PATCH] Revert Remove redundant inheritances from Iterator in
@@ -15,7 +15,7 @@ Subject: [PATCH] Revert Remove redundant inheritances from Iterator in
15
15
7 files changed, 34 insertions(+), 34 deletions(-)
16
16
17
17
diff --git a/mypy/typeshed/stdlib/_asyncio.pyi b/mypy/typeshed/stdlib/_asyncio.pyi
18
- index a25902661..18920cd8a 100644
18
+ index 89cdff6cc..1397e579d 100644
19
19
--- a/mypy/typeshed/stdlib/_asyncio.pyi
20
20
+++ b/mypy/typeshed/stdlib/_asyncio.pyi
21
21
@@ -1,6 +1,6 @@
@@ -36,7 +36,7 @@ index a25902661..18920cd8a 100644
36
36
@property
37
37
def _exception(self) -> BaseException | None: ...
38
38
diff --git a/mypy/typeshed/stdlib/builtins.pyi b/mypy/typeshed/stdlib/builtins.pyi
39
- index 5c6d321f7..56a5969d1 100644
39
+ index b75e34fc5..526406acc 100644
40
40
--- a/mypy/typeshed/stdlib/builtins.pyi
41
41
+++ b/mypy/typeshed/stdlib/builtins.pyi
42
42
@@ -1130,7 +1130,7 @@ class frozenset(AbstractSet[_T_co]):
@@ -64,7 +64,7 @@ index 5c6d321f7..56a5969d1 100644
64
64
- class map(Generic[_S]):
65
65
+ class map(Iterator[_S]):
66
66
@overload
67
- def __new__(cls, func: Callable[[_T1], _S], iter1 : Iterable[_T1], /) -> Self: ...
67
+ def __new__(cls, func: Callable[[_T1], _S], iterable : Iterable[_T1], /) -> Self: ...
68
68
@overload
69
69
@@ -1632,7 +1632,7 @@ def pow(base: _SupportsSomeKindOfPow, exp: complex, mod: None = None) -> complex
70
70
@@ -131,7 +131,7 @@ index bf6daad0a..1e6aa78e2 100644
131
131
# encoding and errors are added
132
132
@overload
133
133
diff --git a/mypy/typeshed/stdlib/itertools.pyi b/mypy/typeshed/stdlib/itertools.pyi
134
- index 013c3cba1..f69665882 100644
134
+ index 55b0814ac..675533d44 100644
135
135
--- a/mypy/typeshed/stdlib/itertools.pyi
136
136
+++ b/mypy/typeshed/stdlib/itertools.pyi
137
137
@@ -29,7 +29,7 @@ _Predicate: TypeAlias = Callable[[_T], object]
@@ -149,14 +149,14 @@ index 013c3cba1..f69665882 100644
149
149
150
150
- class cycle(Generic[_T]):
151
151
+ class cycle(Iterator[_T]):
152
- def __init__(self , iterable: Iterable[_T], /) -> None : ...
152
+ def __new__(cls , iterable: Iterable[_T], /) -> Self : ...
153
153
def __next__(self) -> _T: ...
154
154
def __iter__(self) -> Self: ...
155
155
156
156
- class repeat(Generic[_T]):
157
157
+ class repeat(Iterator[_T]):
158
158
@overload
159
- def __init__(self , object: _T) -> None : ...
159
+ def __new__(cls , object: _T) -> Self : ...
160
160
@overload
161
161
@@ -53,7 +53,7 @@ class repeat(Generic[_T]):
162
162
def __iter__(self) -> Self: ...
@@ -165,15 +165,15 @@ index 013c3cba1..f69665882 100644
165
165
- class accumulate(Generic[_T]):
166
166
+ class accumulate(Iterator[_T]):
167
167
@overload
168
- def __init__(self , iterable: Iterable[_T], func: None = None, *, initial: _T | None = ...) -> None : ...
168
+ def __new__(cls , iterable: Iterable[_T], func: None = None, *, initial: _T | None = ...) -> Self : ...
169
169
@overload
170
170
@@ -61,7 +61,7 @@ class accumulate(Generic[_T]):
171
171
def __iter__(self) -> Self: ...
172
172
def __next__(self) -> _T: ...
173
173
174
174
- class chain(Generic[_T]):
175
175
+ class chain(Iterator[_T]):
176
- def __init__(self , *iterables: Iterable[_T]) -> None : ...
176
+ def __new__(cls , *iterables: Iterable[_T]) -> Self : ...
177
177
def __next__(self) -> _T: ...
178
178
def __iter__(self) -> Self: ...
179
179
@@ -71,22 +71,22 @@ class chain(Generic[_T]):
@@ -182,19 +182,19 @@ index 013c3cba1..f69665882 100644
182
182
183
183
- class compress(Generic[_T]):
184
184
+ class compress(Iterator[_T]):
185
- def __init__(self , data: Iterable[_T], selectors: Iterable[Any]) -> None : ...
185
+ def __new__(cls , data: Iterable[_T], selectors: Iterable[Any]) -> Self : ...
186
186
def __iter__(self) -> Self: ...
187
187
def __next__(self) -> _T: ...
188
188
189
189
- class dropwhile(Generic[_T]):
190
190
+ class dropwhile(Iterator[_T]):
191
- def __init__(self , predicate: _Predicate[_T], iterable: Iterable[_T], /) -> None : ...
191
+ def __new__(cls , predicate: _Predicate[_T], iterable: Iterable[_T], /) -> Self : ...
192
192
def __iter__(self) -> Self: ...
193
193
def __next__(self) -> _T: ...
194
194
195
195
- class filterfalse(Generic[_T]):
196
196
+ class filterfalse(Iterator[_T]):
197
- def __init__(self, predicate : _Predicate[_T] | None, iterable: Iterable[_T], /) -> None : ...
197
+ def __new__(cls, function : _Predicate[_T] | None, iterable: Iterable[_T], /) -> Self : ...
198
198
def __iter__(self) -> Self: ...
199
199
def __next__(self) -> _T: ...
200
200
@@ -210,7 +210,7 @@ index 013c3cba1..f69665882 100644
210
210
- class islice(Generic[_T]):
211
211
+ class islice(Iterator[_T]):
212
212
@overload
213
- def __init__(self , iterable: Iterable[_T], stop: int | None, /) -> None : ...
213
+ def __new__(cls , iterable: Iterable[_T], stop: int | None, /) -> Self : ...
214
214
@overload
215
215
@@ -102,19 +102,19 @@ class islice(Generic[_T]):
216
216
def __iter__(self) -> Self: ...
@@ -224,7 +224,7 @@ index 013c3cba1..f69665882 100644
224
224
225
225
- class takewhile(Generic[_T]):
226
226
+ class takewhile(Iterator[_T]):
227
- def __init__(self , predicate: _Predicate[_T], iterable: Iterable[_T], /) -> None : ...
227
+ def __new__(cls , predicate: _Predicate[_T], iterable: Iterable[_T], /) -> Self : ...
228
228
def __iter__(self) -> Self: ...
229
229
def __next__(self) -> _T: ...
230
230
@@ -288,17 +288,17 @@ index 013c3cba1..f69665882 100644
288
288
def __new__(cls, iterable: Iterable[_T_co], n: int, *, strict: bool = False) -> Self: ...
289
289
else:
290
290
diff --git a/mypy/typeshed/stdlib/multiprocessing/pool.pyi b/mypy/typeshed/stdlib/multiprocessing/pool.pyi
291
- index 61d6d0781..950ed1d8c 100644
291
+ index 2937d45e3..93197e5d4 100644
292
292
--- a/mypy/typeshed/stdlib/multiprocessing/pool.pyi
293
293
+++ b/mypy/typeshed/stdlib/multiprocessing/pool.pyi
294
294
@@ -1,5 +1,5 @@
295
295
import sys
296
296
- from collections.abc import Callable, Iterable, Mapping
297
297
+ from collections.abc import Callable, Iterable, Iterator, Mapping
298
+ from multiprocessing.context import DefaultContext, Process
298
299
from types import TracebackType
299
300
from typing import Any, Final, Generic, TypeVar
300
- from typing_extensions import Self
301
- @@ -36,7 +36,7 @@ class MapResult(ApplyResult[list[_T]]):
301
+ @@ -37,7 +37,7 @@ class MapResult(ApplyResult[list[_T]]):
302
302
error_callback: Callable[[BaseException], object] | None,
303
303
) -> None: ...
304
304
@@ -308,7 +308,7 @@ index 61d6d0781..950ed1d8c 100644
308
308
def __iter__(self) -> Self: ...
309
309
def next(self, timeout: float | None = None) -> _T: ...
310
310
diff --git a/mypy/typeshed/stdlib/sqlite3/__init__.pyi b/mypy/typeshed/stdlib/sqlite3/__init__.pyi
311
- index bc0ff6469..730404bde 100644
311
+ index b83516b4d..724bc3166 100644
312
312
--- a/mypy/typeshed/stdlib/sqlite3/__init__.pyi
313
313
+++ b/mypy/typeshed/stdlib/sqlite3/__init__.pyi
314
314
@@ -397,7 +397,7 @@ class Connection:
0 commit comments