mirror of
https://github.com/python/cpython.git
synced 2025-12-15 21:44:50 +00:00
Issue #24136: Document generalized unpacking, PEP 448
Based on patches by Konstantin Molchanov and Neil Girdhar.
This commit is contained in:
parent
0d18c15fbf
commit
0c0da48aed
5 changed files with 66 additions and 30 deletions
|
|
@ -320,7 +320,7 @@ PEP 448 - Additional Unpacking Generalizations
|
|||
|
||||
:pep:`448` extends the allowed uses of the ``*`` iterable unpacking
|
||||
operator and ``**`` dictionary unpacking operator. It is now possible
|
||||
to use an arbitrary number of unpackings in function calls::
|
||||
to use an arbitrary number of unpackings in :ref:`function calls <calls>`::
|
||||
|
||||
>>> print(*[1], *[2], 3, *[4, 5])
|
||||
1 2 3 4 5
|
||||
|
|
@ -333,7 +333,7 @@ to use an arbitrary number of unpackings in function calls::
|
|||
1 2 3 4
|
||||
|
||||
Similarly, tuple, list, set, and dictionary displays allow multiple
|
||||
unpackings::
|
||||
unpackings (see :ref:`exprlists` and :ref:`dict`)::
|
||||
|
||||
>>> *range(4), 4
|
||||
(0, 1, 2, 3, 4)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue