]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Provide a cross-reference to PEP 798 unpacking syntax (#152454)
authorRaymond Hettinger <rhettinger@users.noreply.github.com>
Sat, 27 Jun 2026 21:17:41 +0000 (16:17 -0500)
committerGitHub <noreply@github.com>
Sat, 27 Jun 2026 21:17:41 +0000 (16:17 -0500)
Co-authored-by: Rishit Agnihotri <Twix1288@users.noreply.github.com>
Doc/library/itertools.rst

index 06f8bf2a8b6fa81383fd0eeb0b52a0e14f3932bf..65442021ce1795d7f603a05374e9c98fa97d8ce0 100644 (file)
@@ -197,6 +197,10 @@ loops that truncate the stream.
           for iterable in iterables:
               yield from iterable
 
+   Note that :pep:`798` unpacking syntax provides similar functionality
+   so that ``list(chain(p, q))`` could be written as
+   ``[*s for s in (p, q)]``.
+
 
 .. classmethod:: chain.from_iterable(iterable)
 
@@ -208,6 +212,10 @@ loops that truncate the stream.
           for iterable in iterables:
               yield from iterable
 
+   Note that :pep:`798` unpacking syntax provides similar functionality
+   so that ``list(chain.from_iterable(iterables))`` could be written as
+   ``[*s for s in iterables]``.
+
 
 .. function:: combinations(iterable, r)