Navigation Menu

Skip to content

Commit

Permalink
Merge pull request realpython#455 from george2/extended-unpacking
Browse files Browse the repository at this point in the history
Added pep-3132 style extended unpacking.
  • Loading branch information
kennethreitz committed Jun 17, 2014
2 parents 2568877 + 59eaef2 commit 9d664e6
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions docs/writing/style.rst
Expand Up @@ -293,6 +293,16 @@ Nested unpacking works too:
a, (b, c) = 1, (2, 3)
In Python 3, a new method of extended unpacking was introduced by
:pep:`3132`:

.. code-block:: python
a, *rest = [1, 2, 3]
# a = 1, rest = [2, 3]
a, *middle, c = [1, 2, 3, 4]
# a = 1, middle = [2, 3], c = 4
Create an ignored variable
~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down

0 comments on commit 9d664e6

Please sign in to comment.