Skip to content

Add missing strict argument for itertools.batched (3.13) #12256

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Jul 2, 2024
Merged
6 changes: 5 additions & 1 deletion stdlib/itertools.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,10 @@ if sys.version_info >= (3, 10):

if sys.version_info >= (3, 12):
class batched(Iterator[tuple[_T_co, ...]], Generic[_T_co]):
def __new__(cls, iterable: Iterable[_T_co], n: int) -> Self: ...
if sys.version_info >= (3, 13):
def __new__(cls, iterable: Iterable[_T_co], n: int, *, strict: bool = False) -> Self: ...
else:
def __new__(cls, iterable: Iterable[_T_co], n: int) -> Self: ...

def __iter__(self) -> Self: ...
def __next__(self) -> tuple[_T_co, ...]: ...