@@ -27,7 +27,7 @@ _Predicate: TypeAlias = Callable[[_T], object]
2727
2828# Technically count can take anything that implements a number protocol and has an add method
2929# but we can't enforce the add method
30- class count (Generic [_N ]):
30+ class count (Iterator [_N ]):
3131 @overload
3232 def __new__ (cls ) -> count [int ]: ...
3333 @overload
@@ -37,12 +37,12 @@ class count(Generic[_N]):
3737 def __next__ (self ) -> _N : ...
3838 def __iter__ (self ) -> Self : ...
3939
40- class cycle (Generic [_T ]):
40+ class cycle (Iterator [_T ]):
4141 def __new__ (cls , iterable : Iterable [_T ], / ) -> Self : ...
4242 def __next__ (self ) -> _T : ...
4343 def __iter__ (self ) -> Self : ...
4444
45- class repeat (Generic [_T ]):
45+ class repeat (Iterator [_T ]):
4646 @overload
4747 def __new__ (cls , object : _T ) -> Self : ...
4848 @overload
@@ -51,15 +51,15 @@ class repeat(Generic[_T]):
5151 def __iter__ (self ) -> Self : ...
5252 def __length_hint__ (self ) -> int : ...
5353
54- class accumulate (Generic [_T ]):
54+ class accumulate (Iterator [_T ]):
5555 @overload
5656 def __new__ (cls , iterable : Iterable [_T ], func : None = None , * , initial : _T | None = ...) -> Self : ...
5757 @overload
5858 def __new__ (cls , iterable : Iterable [_S ], func : Callable [[_T , _S ], _T ], * , initial : _T | None = ...) -> Self : ...
5959 def __iter__ (self ) -> Self : ...
6060 def __next__ (self ) -> _T : ...
6161
62- class chain (Generic [_T ]):
62+ class chain (Iterator [_T ]):
6363 def __new__ (cls , * iterables : Iterable [_T ]) -> Self : ...
6464 def __next__ (self ) -> _T : ...
6565 def __iter__ (self ) -> Self : ...
@@ -68,50 +68,50 @@ class chain(Generic[_T]):
6868 def from_iterable (cls : type [Any ], iterable : Iterable [Iterable [_S ]], / ) -> chain [_S ]: ...
6969 def __class_getitem__ (cls , item : Any , / ) -> GenericAlias : ...
7070
71- class compress (Generic [_T ]):
71+ class compress (Iterator [_T ]):
7272 def __new__ (cls , data : Iterable [_T ], selectors : Iterable [Any ]) -> Self : ...
7373 def __iter__ (self ) -> Self : ...
7474 def __next__ (self ) -> _T : ...
7575
76- class dropwhile (Generic [_T ]):
76+ class dropwhile (Iterator [_T ]):
7777 def __new__ (cls , predicate : _Predicate [_T ], iterable : Iterable [_T ], / ) -> Self : ...
7878 def __iter__ (self ) -> Self : ...
7979 def __next__ (self ) -> _T : ...
8080
81- class filterfalse (Generic [_T ]):
81+ class filterfalse (Iterator [_T ]):
8282 def __new__ (cls , function : _Predicate [_T ] | None , iterable : Iterable [_T ], / ) -> Self : ...
8383 def __iter__ (self ) -> Self : ...
8484 def __next__ (self ) -> _T : ...
8585
86- class groupby (Generic [_T_co , _S_co ]):
86+ class groupby (Iterator [ tuple [ _T_co , Iterator [ _S_co ]]], Generic [_T_co , _S_co ]):
8787 @overload
8888 def __new__ (cls , iterable : Iterable [_T1 ], key : None = None ) -> groupby [_T1 , _T1 ]: ...
8989 @overload
9090 def __new__ (cls , iterable : Iterable [_T1 ], key : Callable [[_T1 ], _T2 ]) -> groupby [_T2 , _T1 ]: ...
9191 def __iter__ (self ) -> Self : ...
9292 def __next__ (self ) -> tuple [_T_co , Iterator [_S_co ]]: ...
9393
94- class islice (Generic [_T ]):
94+ class islice (Iterator [_T ]):
9595 @overload
9696 def __new__ (cls , iterable : Iterable [_T ], stop : int | None , / ) -> Self : ...
9797 @overload
9898 def __new__ (cls , iterable : Iterable [_T ], start : int | None , stop : int | None , step : int | None = ..., / ) -> Self : ...
9999 def __iter__ (self ) -> Self : ...
100100 def __next__ (self ) -> _T : ...
101101
102- class starmap (Generic [_T_co ]):
102+ class starmap (Iterator [_T_co ]):
103103 def __new__ (cls , function : Callable [..., _T ], iterable : Iterable [Iterable [Any ]], / ) -> starmap [_T ]: ...
104104 def __iter__ (self ) -> Self : ...
105105 def __next__ (self ) -> _T_co : ...
106106
107- class takewhile (Generic [_T ]):
107+ class takewhile (Iterator [_T ]):
108108 def __new__ (cls , predicate : _Predicate [_T ], iterable : Iterable [_T ], / ) -> Self : ...
109109 def __iter__ (self ) -> Self : ...
110110 def __next__ (self ) -> _T : ...
111111
112112def tee (iterable : Iterable [_T ], n : int = 2 , / ) -> tuple [Iterator [_T ], ...]: ...
113113
114- class zip_longest (Generic [_T_co ]):
114+ class zip_longest (Iterator [_T_co ]):
115115 # one iterable (fillvalue doesn't matter)
116116 @overload
117117 def __new__ (cls , iter1 : Iterable [_T1 ], / , * , fillvalue : object = ...) -> zip_longest [tuple [_T1 ]]: ...
@@ -189,7 +189,7 @@ class zip_longest(Generic[_T_co]):
189189 def __iter__ (self ) -> Self : ...
190190 def __next__ (self ) -> _T_co : ...
191191
192- class product (Generic [_T_co ]):
192+ class product (Iterator [_T_co ]):
193193 @overload
194194 def __new__ (cls , iter1 : Iterable [_T1 ], / ) -> product [tuple [_T1 ]]: ...
195195 @overload
@@ -274,7 +274,7 @@ class product(Generic[_T_co]):
274274 def __iter__ (self ) -> Self : ...
275275 def __next__ (self ) -> _T_co : ...
276276
277- class permutations (Generic [_T_co ]):
277+ class permutations (Iterator [_T_co ]):
278278 @overload
279279 def __new__ (cls , iterable : Iterable [_T ], r : Literal [2 ]) -> permutations [tuple [_T , _T ]]: ...
280280 @overload
@@ -288,7 +288,7 @@ class permutations(Generic[_T_co]):
288288 def __iter__ (self ) -> Self : ...
289289 def __next__ (self ) -> _T_co : ...
290290
291- class combinations (Generic [_T_co ]):
291+ class combinations (Iterator [_T_co ]):
292292 @overload
293293 def __new__ (cls , iterable : Iterable [_T ], r : Literal [2 ]) -> combinations [tuple [_T , _T ]]: ...
294294 @overload
@@ -302,7 +302,7 @@ class combinations(Generic[_T_co]):
302302 def __iter__ (self ) -> Self : ...
303303 def __next__ (self ) -> _T_co : ...
304304
305- class combinations_with_replacement (Generic [_T_co ]):
305+ class combinations_with_replacement (Iterator [_T_co ]):
306306 @overload
307307 def __new__ (cls , iterable : Iterable [_T ], r : Literal [2 ]) -> combinations_with_replacement [tuple [_T , _T ]]: ...
308308 @overload
@@ -317,13 +317,13 @@ class combinations_with_replacement(Generic[_T_co]):
317317 def __next__ (self ) -> _T_co : ...
318318
319319if sys .version_info >= (3 , 10 ):
320- class pairwise (Generic [_T_co ]):
320+ class pairwise (Iterator [_T_co ]):
321321 def __new__ (cls , iterable : Iterable [_T ], / ) -> pairwise [tuple [_T , _T ]]: ...
322322 def __iter__ (self ) -> Self : ...
323323 def __next__ (self ) -> _T_co : ...
324324
325325if sys .version_info >= (3 , 12 ):
326- class batched (Generic [_T_co ]):
326+ class batched (Iterator [ tuple [ _T_co , ...]], Generic [_T_co ]):
327327 if sys .version_info >= (3 , 13 ):
328328 def __new__ (cls , iterable : Iterable [_T_co ], n : int , * , strict : bool = False ) -> Self : ...
329329 else :
0 commit comments