@@ -29,7 +29,7 @@ _Predicate: TypeAlias = Callable[[_T], object]
29
29
30
30
# Technically count can take anything that implements a number protocol and has an add method
31
31
# but we can't enforce the add method
32
- class count (Generic [_N ]):
32
+ class count (Iterator [_N ]):
33
33
@overload
34
34
def __new__ (cls ) -> count [int ]: ...
35
35
@overload
@@ -39,12 +39,12 @@ class count(Generic[_N]):
39
39
def __next__ (self ) -> _N : ...
40
40
def __iter__ (self ) -> Self : ...
41
41
42
- class cycle (Generic [_T ]):
42
+ class cycle (Iterator [_T ]):
43
43
def __new__ (cls , iterable : Iterable [_T ], / ) -> Self : ...
44
44
def __next__ (self ) -> _T : ...
45
45
def __iter__ (self ) -> Self : ...
46
46
47
- class repeat (Generic [_T ]):
47
+ class repeat (Iterator [_T ]):
48
48
@overload
49
49
def __new__ (cls , object : _T ) -> Self : ...
50
50
@overload
@@ -53,15 +53,15 @@ class repeat(Generic[_T]):
53
53
def __iter__ (self ) -> Self : ...
54
54
def __length_hint__ (self ) -> int : ...
55
55
56
- class accumulate (Generic [_T ]):
56
+ class accumulate (Iterator [_T ]):
57
57
@overload
58
58
def __new__ (cls , iterable : Iterable [_T ], func : None = None , * , initial : _T | None = ...) -> Self : ...
59
59
@overload
60
60
def __new__ (cls , iterable : Iterable [_S ], func : Callable [[_T , _S ], _T ], * , initial : _T | None = ...) -> Self : ...
61
61
def __iter__ (self ) -> Self : ...
62
62
def __next__ (self ) -> _T : ...
63
63
64
- class chain (Generic [_T ]):
64
+ class chain (Iterator [_T ]):
65
65
def __new__ (cls , * iterables : Iterable [_T ]) -> Self : ...
66
66
def __next__ (self ) -> _T : ...
67
67
def __iter__ (self ) -> Self : ...
@@ -71,50 +71,50 @@ class chain(Generic[_T]):
71
71
if sys .version_info >= (3 , 9 ):
72
72
def __class_getitem__ (cls , item : Any , / ) -> GenericAlias : ...
73
73
74
- class compress (Generic [_T ]):
74
+ class compress (Iterator [_T ]):
75
75
def __new__ (cls , data : Iterable [_T ], selectors : Iterable [Any ]) -> Self : ...
76
76
def __iter__ (self ) -> Self : ...
77
77
def __next__ (self ) -> _T : ...
78
78
79
- class dropwhile (Generic [_T ]):
79
+ class dropwhile (Iterator [_T ]):
80
80
def __new__ (cls , predicate : _Predicate [_T ], iterable : Iterable [_T ], / ) -> Self : ...
81
81
def __iter__ (self ) -> Self : ...
82
82
def __next__ (self ) -> _T : ...
83
83
84
- class filterfalse (Generic [_T ]):
84
+ class filterfalse (Iterator [_T ]):
85
85
def __new__ (cls , function : _Predicate [_T ] | None , iterable : Iterable [_T ], / ) -> Self : ...
86
86
def __iter__ (self ) -> Self : ...
87
87
def __next__ (self ) -> _T : ...
88
88
89
- class groupby (Generic [_T_co , _S_co ]):
89
+ class groupby (Iterator [ tuple [ _T_co , Iterator [ _S_co ]]], Generic [_T_co , _S_co ]):
90
90
@overload
91
91
def __new__ (cls , iterable : Iterable [_T1 ], key : None = None ) -> groupby [_T1 , _T1 ]: ...
92
92
@overload
93
93
def __new__ (cls , iterable : Iterable [_T1 ], key : Callable [[_T1 ], _T2 ]) -> groupby [_T2 , _T1 ]: ...
94
94
def __iter__ (self ) -> Self : ...
95
95
def __next__ (self ) -> tuple [_T_co , Iterator [_S_co ]]: ...
96
96
97
- class islice (Generic [_T ]):
97
+ class islice (Iterator [_T ]):
98
98
@overload
99
99
def __new__ (cls , iterable : Iterable [_T ], stop : int | None , / ) -> Self : ...
100
100
@overload
101
101
def __new__ (cls , iterable : Iterable [_T ], start : int | None , stop : int | None , step : int | None = ..., / ) -> Self : ...
102
102
def __iter__ (self ) -> Self : ...
103
103
def __next__ (self ) -> _T : ...
104
104
105
- class starmap (Generic [_T_co ]):
105
+ class starmap (Iterator [_T_co ]):
106
106
def __new__ (cls , function : Callable [..., _T ], iterable : Iterable [Iterable [Any ]], / ) -> starmap [_T ]: ...
107
107
def __iter__ (self ) -> Self : ...
108
108
def __next__ (self ) -> _T_co : ...
109
109
110
- class takewhile (Generic [_T ]):
110
+ class takewhile (Iterator [_T ]):
111
111
def __new__ (cls , predicate : _Predicate [_T ], iterable : Iterable [_T ], / ) -> Self : ...
112
112
def __iter__ (self ) -> Self : ...
113
113
def __next__ (self ) -> _T : ...
114
114
115
115
def tee (iterable : Iterable [_T ], n : int = 2 , / ) -> tuple [Iterator [_T ], ...]: ...
116
116
117
- class zip_longest (Generic [_T_co ]):
117
+ class zip_longest (Iterator [_T_co ]):
118
118
# one iterable (fillvalue doesn't matter)
119
119
@overload
120
120
def __new__ (cls , iter1 : Iterable [_T1 ], / , * , fillvalue : object = ...) -> zip_longest [tuple [_T1 ]]: ...
@@ -192,7 +192,7 @@ class zip_longest(Generic[_T_co]):
192
192
def __iter__ (self ) -> Self : ...
193
193
def __next__ (self ) -> _T_co : ...
194
194
195
- class product (Generic [_T_co ]):
195
+ class product (Iterator [_T_co ]):
196
196
@overload
197
197
def __new__ (cls , iter1 : Iterable [_T1 ], / ) -> product [tuple [_T1 ]]: ...
198
198
@overload
@@ -277,7 +277,7 @@ class product(Generic[_T_co]):
277
277
def __iter__ (self ) -> Self : ...
278
278
def __next__ (self ) -> _T_co : ...
279
279
280
- class permutations (Generic [_T_co ]):
280
+ class permutations (Iterator [_T_co ]):
281
281
@overload
282
282
def __new__ (cls , iterable : Iterable [_T ], r : Literal [2 ]) -> permutations [tuple [_T , _T ]]: ...
283
283
@overload
@@ -291,7 +291,7 @@ class permutations(Generic[_T_co]):
291
291
def __iter__ (self ) -> Self : ...
292
292
def __next__ (self ) -> _T_co : ...
293
293
294
- class combinations (Generic [_T_co ]):
294
+ class combinations (Iterator [_T_co ]):
295
295
@overload
296
296
def __new__ (cls , iterable : Iterable [_T ], r : Literal [2 ]) -> combinations [tuple [_T , _T ]]: ...
297
297
@overload
@@ -305,7 +305,7 @@ class combinations(Generic[_T_co]):
305
305
def __iter__ (self ) -> Self : ...
306
306
def __next__ (self ) -> _T_co : ...
307
307
308
- class combinations_with_replacement (Generic [_T_co ]):
308
+ class combinations_with_replacement (Iterator [_T_co ]):
309
309
@overload
310
310
def __new__ (cls , iterable : Iterable [_T ], r : Literal [2 ]) -> combinations_with_replacement [tuple [_T , _T ]]: ...
311
311
@overload
@@ -320,13 +320,13 @@ class combinations_with_replacement(Generic[_T_co]):
320
320
def __next__ (self ) -> _T_co : ...
321
321
322
322
if sys .version_info >= (3 , 10 ):
323
- class pairwise (Generic [_T_co ]):
323
+ class pairwise (Iterator [_T_co ]):
324
324
def __new__ (cls , iterable : Iterable [_T ], / ) -> pairwise [tuple [_T , _T ]]: ...
325
325
def __iter__ (self ) -> Self : ...
326
326
def __next__ (self ) -> _T_co : ...
327
327
328
328
if sys .version_info >= (3 , 12 ):
329
- class batched (Generic [_T_co ]):
329
+ class batched (Iterator [ tuple [ _T_co , ...]], Generic [_T_co ]):
330
330
if sys .version_info >= (3 , 13 ):
331
331
def __new__ (cls , iterable : Iterable [_T_co ], n : int , * , strict : bool = False ) -> Self : ...
332
332
else :
0 commit comments