Skip to content

Commit 26caf56

Browse files
miss-islingtonrhettingerTwix1288
authored
[3.15] gh-152397: Provide a cross-reference to PEP 798 unpacking syntax (GH-152454) (#152460)
Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com> Co-authored-by: Rishit Agnihotri <Twix1288@users.noreply.github.com>
1 parent a75aa41 commit 26caf56

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

Doc/library/itertools.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,10 @@ loops that truncate the stream.
197197
for iterable in iterables:
198198
yield from iterable
199199

200+
Note that :pep:`798` unpacking syntax provides similar functionality
201+
so that ``list(chain(p, q))`` could be written as
202+
``[*s for s in (p, q)]``.
203+
200204

201205
.. classmethod:: chain.from_iterable(iterable)
202206

@@ -208,6 +212,10 @@ loops that truncate the stream.
208212
for iterable in iterables:
209213
yield from iterable
210214

215+
Note that :pep:`798` unpacking syntax provides similar functionality
216+
so that ``list(chain.from_iterable(iterables))`` could be written as
217+
``[*s for s in iterables]``.
218+
211219

212220
.. function:: combinations(iterable, r)
213221

0 commit comments

Comments
 (0)