From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Sun, 28 Jun 2026 03:55:04 +0000 (+0200) Subject: [3.15] gh-152397: Provide a cross-reference to PEP 798 unpacking syntax (GH-152454... X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=26caf56ec3a5b5c4c89f25e3ca8b4720eb4af976;p=thirdparty%2FPython%2Fcpython.git [3.15] gh-152397: Provide a cross-reference to PEP 798 unpacking syntax (GH-152454) (#152460) Co-authored-by: Raymond Hettinger Co-authored-by: Rishit Agnihotri --- diff --git a/Doc/library/itertools.rst b/Doc/library/itertools.rst index 06f8bf2a8b6f..65442021ce17 100644 --- a/Doc/library/itertools.rst +++ b/Doc/library/itertools.rst @@ -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)