@@ -29,7 +29,7 @@ _Predicate: TypeAlias = Callable[[_T], object]
2929
3030# Technically count can take anything that implements a number protocol and has an add method
3131# but we can't enforce the add method
32- class count (Generic [_N ]):
32+ class count (Iterator [_N ]):
3333 @overload
3434 def __new__ (cls ) -> count [int ]: ...
3535 @overload
@@ -39,12 +39,12 @@ class count(Generic[_N]):
3939 def __next__ (self ) -> _N : ...
4040 def __iter__ (self ) -> Self : ...
4141
42- class cycle (Generic [_T ]):
42+ class cycle (Iterator [_T ]):
4343 def __new__ (cls , iterable : Iterable [_T ], / ) -> Self : ...
4444 def __next__ (self ) -> _T : ...
4545 def __iter__ (self ) -> Self : ...
4646
47- class repeat (Generic [_T ]):
47+ class repeat (Iterator [_T ]):
4848 @overload
4949 def __new__ (cls , object : _T ) -> Self : ...
5050 @overload
@@ -53,15 +53,15 @@ class repeat(Generic[_T]):
5353 def __iter__ (self ) -> Self : ...
5454 def __length_hint__ (self ) -> int : ...
5555
56- class accumulate (Generic [_T ]):
56+ class accumulate (Iterator [_T ]):
5757 @overload
5858 def __new__ (cls , iterable : Iterable [_T ], func : None = None , * , initial : _T | None = ...) -> Self : ...
5959 @overload
6060 def __new__ (cls , iterable : Iterable [_S ], func : Callable [[_T , _S ], _T ], * , initial : _T | None = ...) -> Self : ...
6161 def __iter__ (self ) -> Self : ...
6262 def __next__ (self ) -> _T : ...
6363
64- class chain (Generic [_T ]):
64+ class chain (Iterator [_T ]):
6565 def __new__ (cls , * iterables : Iterable [_T ]) -> Self : ...
6666 def __next__ (self ) -> _T : ...
6767 def __iter__ (self ) -> Self : ...
@@ -71,50 +71,50 @@ class chain(Generic[_T]):
7171 if sys .version_info >= (3 , 9 ):
7272 def __class_getitem__ (cls , item : Any , / ) -> GenericAlias : ...
7373
74- class compress (Generic [_T ]):
74+ class compress (Iterator [_T ]):
7575 def __new__ (cls , data : Iterable [_T ], selectors : Iterable [Any ]) -> Self : ...
7676 def __iter__ (self ) -> Self : ...
7777 def __next__ (self ) -> _T : ...
7878
79- class dropwhile (Generic [_T ]):
79+ class dropwhile (Iterator [_T ]):
8080 def __new__ (cls , predicate : _Predicate [_T ], iterable : Iterable [_T ], / ) -> Self : ...
8181 def __iter__ (self ) -> Self : ...
8282 def __next__ (self ) -> _T : ...
8383
84- class filterfalse (Generic [_T ]):
84+ class filterfalse (Iterator [_T ]):
8585 def __new__ (cls , function : _Predicate [_T ] | None , iterable : Iterable [_T ], / ) -> Self : ...
8686 def __iter__ (self ) -> Self : ...
8787 def __next__ (self ) -> _T : ...
8888
89- class groupby (Generic [_T_co , _S_co ]):
89+ class groupby (Iterator [ tuple [ _T_co , Iterator [ _S_co ]]], Generic [_T_co , _S_co ]):
9090 @overload
9191 def __new__ (cls , iterable : Iterable [_T1 ], key : None = None ) -> groupby [_T1 , _T1 ]: ...
9292 @overload
9393 def __new__ (cls , iterable : Iterable [_T1 ], key : Callable [[_T1 ], _T2 ]) -> groupby [_T2 , _T1 ]: ...
9494 def __iter__ (self ) -> Self : ...
9595 def __next__ (self ) -> tuple [_T_co , Iterator [_S_co ]]: ...
9696
97- class islice (Generic [_T ]):
97+ class islice (Iterator [_T ]):
9898 @overload
9999 def __new__ (cls , iterable : Iterable [_T ], stop : int | None , / ) -> Self : ...
100100 @overload
101101 def __new__ (cls , iterable : Iterable [_T ], start : int | None , stop : int | None , step : int | None = ..., / ) -> Self : ...
102102 def __iter__ (self ) -> Self : ...
103103 def __next__ (self ) -> _T : ...
104104
105- class starmap (Generic [_T_co ]):
105+ class starmap (Iterator [_T_co ]):
106106 def __new__ (cls , function : Callable [..., _T ], iterable : Iterable [Iterable [Any ]], / ) -> starmap [_T ]: ...
107107 def __iter__ (self ) -> Self : ...
108108 def __next__ (self ) -> _T_co : ...
109109
110- class takewhile (Generic [_T ]):
110+ class takewhile (Iterator [_T ]):
111111 def __new__ (cls , predicate : _Predicate [_T ], iterable : Iterable [_T ], / ) -> Self : ...
112112 def __iter__ (self ) -> Self : ...
113113 def __next__ (self ) -> _T : ...
114114
115115def tee (iterable : Iterable [_T ], n : int = 2 , / ) -> tuple [Iterator [_T ], ...]: ...
116116
117- class zip_longest (Generic [_T_co ]):
117+ class zip_longest (Iterator [_T_co ]):
118118 # one iterable (fillvalue doesn't matter)
119119 @overload
120120 def __new__ (cls , iter1 : Iterable [_T1 ], / , * , fillvalue : object = ...) -> zip_longest [tuple [_T1 ]]: ...
@@ -192,7 +192,7 @@ class zip_longest(Generic[_T_co]):
192192 def __iter__ (self ) -> Self : ...
193193 def __next__ (self ) -> _T_co : ...
194194
195- class product (Generic [_T_co ]):
195+ class product (Iterator [_T_co ]):
196196 @overload
197197 def __new__ (cls , iter1 : Iterable [_T1 ], / ) -> product [tuple [_T1 ]]: ...
198198 @overload
@@ -277,7 +277,7 @@ class product(Generic[_T_co]):
277277 def __iter__ (self ) -> Self : ...
278278 def __next__ (self ) -> _T_co : ...
279279
280- class permutations (Generic [_T_co ]):
280+ class permutations (Iterator [_T_co ]):
281281 @overload
282282 def __new__ (cls , iterable : Iterable [_T ], r : Literal [2 ]) -> permutations [tuple [_T , _T ]]: ...
283283 @overload
@@ -291,7 +291,7 @@ class permutations(Generic[_T_co]):
291291 def __iter__ (self ) -> Self : ...
292292 def __next__ (self ) -> _T_co : ...
293293
294- class combinations (Generic [_T_co ]):
294+ class combinations (Iterator [_T_co ]):
295295 @overload
296296 def __new__ (cls , iterable : Iterable [_T ], r : Literal [2 ]) -> combinations [tuple [_T , _T ]]: ...
297297 @overload
@@ -305,7 +305,7 @@ class combinations(Generic[_T_co]):
305305 def __iter__ (self ) -> Self : ...
306306 def __next__ (self ) -> _T_co : ...
307307
308- class combinations_with_replacement (Generic [_T_co ]):
308+ class combinations_with_replacement (Iterator [_T_co ]):
309309 @overload
310310 def __new__ (cls , iterable : Iterable [_T ], r : Literal [2 ]) -> combinations_with_replacement [tuple [_T , _T ]]: ...
311311 @overload
@@ -320,13 +320,13 @@ class combinations_with_replacement(Generic[_T_co]):
320320 def __next__ (self ) -> _T_co : ...
321321
322322if sys .version_info >= (3 , 10 ):
323- class pairwise (Generic [_T_co ]):
323+ class pairwise (Iterator [_T_co ]):
324324 def __new__ (cls , iterable : Iterable [_T ], / ) -> pairwise [tuple [_T , _T ]]: ...
325325 def __iter__ (self ) -> Self : ...
326326 def __next__ (self ) -> _T_co : ...
327327
328328if sys .version_info >= (3 , 12 ):
329- class batched (Generic [_T_co ]):
329+ class batched (Iterator [ tuple [ _T_co , ...]], Generic [_T_co ]):
330330 if sys .version_info >= (3 , 13 ):
331331 def __new__ (cls , iterable : Iterable [_T_co ], n : int , * , strict : bool = False ) -> Self : ...
332332 else :
0 commit comments