From: wim glenn Date: Tue, 21 Mar 2023 17:06:18 +0000 (-0500) Subject: gh-102876: remove superfluous parens from itertools.batched recipe (GH-102877) X-Git-Tag: v3.12.0a7~112 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4bb1dd3c5c14338c9d9cea5988431c858b3b76e0;p=thirdparty%2FPython%2Fcpython.git gh-102876: remove superfluous parens from itertools.batched recipe (GH-102877) remove superfluous parens from itertools.batched recipe --- diff --git a/Doc/library/itertools.rst b/Doc/library/itertools.rst index 78f64ea67e25..38bc369d410d 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 7014bc97100c..9fe559d4b7ee 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(