@@ -28,7 +28,7 @@ _Predicate: TypeAlias = Callable[[_T], object]
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
3030@disjoint_base
31- class count (Generic [_N ]):
31+ class count (Iterator [_N ]):
3232 @overload
3333 def __new__ (cls ) -> count [int ]: ...
3434 @overload
@@ -39,13 +39,13 @@ class count(Generic[_N]):
3939 def __iter__ (self ) -> Self : ...
4040
4141@disjoint_base
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
4747@disjoint_base
48- class repeat (Generic [_T ]):
48+ class repeat (Iterator [_T ]):
4949 @overload
5050 def __new__ (cls , object : _T ) -> Self : ...
5151 @overload
@@ -55,7 +55,7 @@ class repeat(Generic[_T]):
5555 def __length_hint__ (self ) -> int : ...
5656
5757@disjoint_base
58- class accumulate (Generic [_T ]):
58+ class accumulate (Iterator [_T ]):
5959 @overload
6060 def __new__ (cls , iterable : Iterable [_T ], func : None = None , * , initial : _T | None = ...) -> Self : ...
6161 @overload
@@ -64,7 +64,7 @@ class accumulate(Generic[_T]):
6464 def __next__ (self ) -> _T : ...
6565
6666@disjoint_base
67- class chain (Generic [_T ]):
67+ class chain (Iterator [_T ]):
6868 def __new__ (cls , * iterables : Iterable [_T ]) -> Self : ...
6969 def __next__ (self ) -> _T : ...
7070 def __iter__ (self ) -> Self : ...
@@ -74,25 +74,25 @@ class chain(Generic[_T]):
7474 def __class_getitem__ (cls , item : Any , / ) -> GenericAlias : ...
7575
7676@disjoint_base
77- class compress (Generic [_T ]):
77+ class compress (Iterator [_T ]):
7878 def __new__ (cls , data : Iterable [_T ], selectors : Iterable [Any ]) -> Self : ...
7979 def __iter__ (self ) -> Self : ...
8080 def __next__ (self ) -> _T : ...
8181
8282@disjoint_base
83- class dropwhile (Generic [_T ]):
83+ class dropwhile (Iterator [_T ]):
8484 def __new__ (cls , predicate : _Predicate [_T ], iterable : Iterable [_T ], / ) -> Self : ...
8585 def __iter__ (self ) -> Self : ...
8686 def __next__ (self ) -> _T : ...
8787
8888@disjoint_base
89- class filterfalse (Generic [_T ]):
89+ class filterfalse (Iterator [_T ]):
9090 def __new__ (cls , function : _Predicate [_T ] | None , iterable : Iterable [_T ], / ) -> Self : ...
9191 def __iter__ (self ) -> Self : ...
9292 def __next__ (self ) -> _T : ...
9393
9494@disjoint_base
95- class groupby (Generic [_T_co , _S_co ]):
95+ class groupby (Iterator [ tuple [ _T_co , Iterator [ _S_co ]]], Generic [_T_co , _S_co ]):
9696 @overload
9797 def __new__ (cls , iterable : Iterable [_T1 ], key : None = None ) -> groupby [_T1 , _T1 ]: ...
9898 @overload
@@ -101,7 +101,7 @@ class groupby(Generic[_T_co, _S_co]):
101101 def __next__ (self ) -> tuple [_T_co , Iterator [_S_co ]]: ...
102102
103103@disjoint_base
104- class islice (Generic [_T ]):
104+ class islice (Iterator [_T ]):
105105 @overload
106106 def __new__ (cls , iterable : Iterable [_T ], stop : int | None , / ) -> Self : ...
107107 @overload
@@ -110,20 +110,20 @@ class islice(Generic[_T]):
110110 def __next__ (self ) -> _T : ...
111111
112112@disjoint_base
113- class starmap (Generic [_T_co ]):
113+ class starmap (Iterator [_T_co ]):
114114 def __new__ (cls , function : Callable [..., _T ], iterable : Iterable [Iterable [Any ]], / ) -> starmap [_T ]: ...
115115 def __iter__ (self ) -> Self : ...
116116 def __next__ (self ) -> _T_co : ...
117117
118118@disjoint_base
119- class takewhile (Generic [_T ]):
119+ class takewhile (Iterator [_T ]):
120120 def __new__ (cls , predicate : _Predicate [_T ], iterable : Iterable [_T ], / ) -> Self : ...
121121 def __iter__ (self ) -> Self : ...
122122 def __next__ (self ) -> _T : ...
123123
124124def tee (iterable : Iterable [_T ], n : int = 2 , / ) -> tuple [Iterator [_T ], ...]: ...
125125@disjoint_base
126- class zip_longest (Generic [_T_co ]):
126+ class zip_longest (Iterator [_T_co ]):
127127 # one iterable (fillvalue doesn't matter)
128128 @overload
129129 def __new__ (cls , iter1 : Iterable [_T1 ], / , * , fillvalue : object = ...) -> zip_longest [tuple [_T1 ]]: ...
@@ -202,7 +202,7 @@ class zip_longest(Generic[_T_co]):
202202 def __next__ (self ) -> _T_co : ...
203203
204204@disjoint_base
205- class product (Generic [_T_co ]):
205+ class product (Iterator [_T_co ]):
206206 @overload
207207 def __new__ (cls , iter1 : Iterable [_T1 ], / ) -> product [tuple [_T1 ]]: ...
208208 @overload
@@ -288,7 +288,7 @@ class product(Generic[_T_co]):
288288 def __next__ (self ) -> _T_co : ...
289289
290290@disjoint_base
291- class permutations (Generic [_T_co ]):
291+ class permutations (Iterator [_T_co ]):
292292 @overload
293293 def __new__ (cls , iterable : Iterable [_T ], r : Literal [2 ]) -> permutations [tuple [_T , _T ]]: ...
294294 @overload
@@ -303,7 +303,7 @@ class permutations(Generic[_T_co]):
303303 def __next__ (self ) -> _T_co : ...
304304
305305@disjoint_base
306- class combinations (Generic [_T_co ]):
306+ class combinations (Iterator [_T_co ]):
307307 @overload
308308 def __new__ (cls , iterable : Iterable [_T ], r : Literal [2 ]) -> combinations [tuple [_T , _T ]]: ...
309309 @overload
@@ -318,7 +318,7 @@ class combinations(Generic[_T_co]):
318318 def __next__ (self ) -> _T_co : ...
319319
320320@disjoint_base
321- class combinations_with_replacement (Generic [_T_co ]):
321+ class combinations_with_replacement (Iterator [_T_co ]):
322322 @overload
323323 def __new__ (cls , iterable : Iterable [_T ], r : Literal [2 ]) -> combinations_with_replacement [tuple [_T , _T ]]: ...
324324 @overload
@@ -334,14 +334,14 @@ class combinations_with_replacement(Generic[_T_co]):
334334
335335if sys .version_info >= (3 , 10 ):
336336 @disjoint_base
337- class pairwise (Generic [_T_co ]):
337+ class pairwise (Iterator [_T_co ]):
338338 def __new__ (cls , iterable : Iterable [_T ], / ) -> pairwise [tuple [_T , _T ]]: ...
339339 def __iter__ (self ) -> Self : ...
340340 def __next__ (self ) -> _T_co : ...
341341
342342if sys .version_info >= (3 , 12 ):
343343 @disjoint_base
344- class batched (Generic [_T_co ]):
344+ class batched (Iterator [ tuple [ _T_co , ...]], Generic [_T_co ]):
345345 if sys .version_info >= (3 , 13 ):
346346 def __new__ (cls , iterable : Iterable [_T_co ], n : int , * , strict : bool = False ) -> Self : ...
347347 else :
0 commit comments