summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwim glenn <wim.glenn@gmail.com>2023-03-21 17:06:18 (GMT)
committerGitHub <noreply@github.com>2023-03-21 17:06:18 (GMT)
commit4bb1dd3c5c14338c9d9cea5988431c858b3b76e0 (patch)
treec462e099c0825d31449702cfc8ba0f8431be6bc7
parent3bb475662ba998e1b2d26fa370794d0804e33927 (diff)
downloadcpython-4bb1dd3c5c14338c9d9cea5988431c858b3b76e0.zip
cpython-4bb1dd3c5c14338c9d9cea5988431c858b3b76e0.tar.gz
cpython-4bb1dd3c5c14338c9d9cea5988431c858b3b76e0.tar.bz2
gh-102876: remove superfluous parens from itertools.batched recipe (GH-102877)
remove superfluous parens from itertools.batched recipe
-rw-r--r--Doc/library/itertools.rst2
-rw-r--r--Lib/test/test_itertools.py2
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(