Skip to content

Commit 8107c53

Browse files
authored
Provide a cross-reference to PEP 798 unpacking syntax (#152454)
Co-authored-by: Rishit Agnihotri <Twix1288@users.noreply.github.com>
1 parent 0ed6711 commit 8107c53

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)