From b678f7510ab7ec7c1d5344975ef1aec780ff756c Mon Sep 17 00:00:00 2001 From: Maxwell Muoto <41130755+max-muoto@users.noreply.github.com> Date: Mon, 1 Jul 2024 22:18:35 -0500 Subject: [PATCH 1/8] Add missing `strict` argument for 3.13 --- stdlib/itertools.pyi | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/stdlib/itertools.pyi b/stdlib/itertools.pyi index 16e04829c6cf..1330685ba6e5 100644 --- a/stdlib/itertools.pyi +++ b/stdlib/itertools.pyi @@ -326,6 +326,9 @@ 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, 12): + 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: ... def __iter__(self) -> Self: ... def __next__(self) -> tuple[_T_co, ...]: ... From f1e1bdf5bc637e1b45e746595b2761fad1fa0123 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 2 Jul 2024 03:21:11 +0000 Subject: [PATCH 2/8] [pre-commit.ci] auto fixes from pre-commit.com hooks --- stdlib/itertools.pyi | 1 + 1 file changed, 1 insertion(+) diff --git a/stdlib/itertools.pyi b/stdlib/itertools.pyi index 1330685ba6e5..5ae6d813fe85 100644 --- a/stdlib/itertools.pyi +++ b/stdlib/itertools.pyi @@ -330,5 +330,6 @@ if sys.version_info >= (3, 12): 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: ... + def __iter__(self) -> Self: ... def __next__(self) -> tuple[_T_co, ...]: ... From 4333fe956af7f48556ca50e340bdb396b3d2e61e Mon Sep 17 00:00:00 2001 From: Maxwell Muoto <41130755+max-muoto@users.noreply.github.com> Date: Mon, 1 Jul 2024 22:25:10 -0500 Subject: [PATCH 3/8] Tweak --- stdlib/itertools.pyi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stdlib/itertools.pyi b/stdlib/itertools.pyi index 5ae6d813fe85..8a3a28c6940a 100644 --- a/stdlib/itertools.pyi +++ b/stdlib/itertools.pyi @@ -326,10 +326,10 @@ if sys.version_info >= (3, 10): if sys.version_info >= (3, 12): class batched(Iterator[tuple[_T_co, ...]], Generic[_T_co]): - if sys.version_info == (3, 12): - 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: ... + elif sys.version_info == (3, 12): + def __new__(cls, iterable: Iterable[_T_co], n: int) -> Self: ... def __iter__(self) -> Self: ... def __next__(self) -> tuple[_T_co, ...]: ... From 263e94937e94af5b5381842fe3f1af493219f9d1 Mon Sep 17 00:00:00 2001 From: Maxwell Muoto <41130755+max-muoto@users.noreply.github.com> Date: Mon, 1 Jul 2024 22:25:21 -0500 Subject: [PATCH 4/8] Tweak --- stdlib/itertools.pyi | 1 - 1 file changed, 1 deletion(-) diff --git a/stdlib/itertools.pyi b/stdlib/itertools.pyi index 8a3a28c6940a..81476b155cf6 100644 --- a/stdlib/itertools.pyi +++ b/stdlib/itertools.pyi @@ -330,6 +330,5 @@ if sys.version_info >= (3, 12): def __new__(cls, iterable: Iterable[_T_co], n: int, *, strict: bool = False) -> Self: ... elif sys.version_info == (3, 12): def __new__(cls, iterable: Iterable[_T_co], n: int) -> Self: ... - def __iter__(self) -> Self: ... def __next__(self) -> tuple[_T_co, ...]: ... From 8821ae6481eb3a587f67fccc971d3ec660276b21 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 2 Jul 2024 03:28:16 +0000 Subject: [PATCH 5/8] [pre-commit.ci] auto fixes from pre-commit.com hooks --- stdlib/itertools.pyi | 1 + 1 file changed, 1 insertion(+) diff --git a/stdlib/itertools.pyi b/stdlib/itertools.pyi index 81476b155cf6..8a3a28c6940a 100644 --- a/stdlib/itertools.pyi +++ b/stdlib/itertools.pyi @@ -330,5 +330,6 @@ if sys.version_info >= (3, 12): def __new__(cls, iterable: Iterable[_T_co], n: int, *, strict: bool = False) -> Self: ... elif sys.version_info == (3, 12): def __new__(cls, iterable: Iterable[_T_co], n: int) -> Self: ... + def __iter__(self) -> Self: ... def __next__(self) -> tuple[_T_co, ...]: ... From 9e4b527e955bd9f51ade27b19e97f47bf1c01ffd Mon Sep 17 00:00:00 2001 From: Maxwell Muoto <41130755+max-muoto@users.noreply.github.com> Date: Mon, 1 Jul 2024 22:29:04 -0500 Subject: [PATCH 6/8] Tweak --- stdlib/itertools.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/itertools.pyi b/stdlib/itertools.pyi index 8a3a28c6940a..1635b6a0a072 100644 --- a/stdlib/itertools.pyi +++ b/stdlib/itertools.pyi @@ -328,7 +328,7 @@ if sys.version_info >= (3, 12): class batched(Iterator[tuple[_T_co, ...]], Generic[_T_co]): if sys.version_info >= (3, 13): def __new__(cls, iterable: Iterable[_T_co], n: int, *, strict: bool = False) -> Self: ... - elif sys.version_info == (3, 12): + else: def __new__(cls, iterable: Iterable[_T_co], n: int) -> Self: ... def __iter__(self) -> Self: ... From 56f72fde0730d71b621a46811ccb44b720c35890 Mon Sep 17 00:00:00 2001 From: Maxwell Muoto <41130755+max-muoto@users.noreply.github.com> Date: Mon, 1 Jul 2024 22:40:11 -0500 Subject: [PATCH 7/8] Add exemption --- stdlib/@tests/stubtest_allowlists/py313.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/stdlib/@tests/stubtest_allowlists/py313.txt b/stdlib/@tests/stubtest_allowlists/py313.txt index 3da3b81a140c..1a7b9b86dff0 100644 --- a/stdlib/@tests/stubtest_allowlists/py313.txt +++ b/stdlib/@tests/stubtest_allowlists/py313.txt @@ -102,6 +102,7 @@ importlib.resources.open_text importlib.resources.path importlib.resources.read_binary importlib.resources.read_text +itertools.batched mailbox.Maildir.add_flag mailbox.Maildir.get_flags mailbox.Maildir.get_info From 1a256b957cf58d44d6971860895e685317040076 Mon Sep 17 00:00:00 2001 From: Maxwell Muoto <41130755+max-muoto@users.noreply.github.com> Date: Mon, 1 Jul 2024 22:47:27 -0500 Subject: [PATCH 8/8] Remove --- stdlib/@tests/stubtest_allowlists/py313.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/stdlib/@tests/stubtest_allowlists/py313.txt b/stdlib/@tests/stubtest_allowlists/py313.txt index 1a7b9b86dff0..3da3b81a140c 100644 --- a/stdlib/@tests/stubtest_allowlists/py313.txt +++ b/stdlib/@tests/stubtest_allowlists/py313.txt @@ -102,7 +102,6 @@ importlib.resources.open_text importlib.resources.path importlib.resources.read_binary importlib.resources.read_text -itertools.batched mailbox.Maildir.add_flag mailbox.Maildir.get_flags mailbox.Maildir.get_info