From 4bb1dd3c5c14338c9d9cea5988431c858b3b76e0 Mon Sep 17 00:00:00 2001 From: wim glenn Date: Tue, 21 Mar 2023 12:06:18 -0500 Subject: gh-102876: remove superfluous parens from itertools.batched recipe (GH-102877) remove superfluous parens from itertools.batched recipe --- Doc/library/itertools.rst | 2 +- Lib/test/test_itertools.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/library/itertools.rst b/Doc/library/itertools.rst index 78f64ea..38bc369 100644 --- a/Doc/library/itertools.rst +++ b/Doc/library/itertools.rst @@ -195,7 +195,7 @@ loops that truncate the stream. if n < 1: raise ValueError('n must be at least one') it = iter(iterable) - while (batch := tuple(islice(it, n))): + while batch := tuple(islice(it, n)): yield batch .. versionadded:: 3.12 diff --git a/Lib/test/test_itertools.py b/Lib/test/test_itertools.py index 7014bc9..9fe559d 100644 --- a/Lib/test/test_itertools.py +++ b/Lib/test/test_itertools.py @@ -1846,7 +1846,7 @@ class TestPurePythonRoughEquivalents(unittest.TestCase): if n < 1: raise ValueError('n must be at least one') it = iter(iterable) - while (batch := tuple(islice(it, n))): + while batch := tuple(islice(it, n)): yield batch for iterable, n in product( -- cgit v0.12