Merge pull request #455 from george2/extended-unpacking

Added pep-3132 style extended unpacking.
This commit is contained in:
2014-06-18 03:01:15 +08:00
+10
View File
@@ -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
~~~~~~~~~~~~~~~~~~~~~~~~~~