Added pep-3132 style extended unpacking.

This commit is contained in:
george
2014-06-17 12:27:44 -06:00
parent 63d836ebf9
commit 59eaef2f78
+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
~~~~~~~~~~~~~~~~~~~~~~~~~~