Adding nested unpacking
authorguibog <guibog@douban.com>
Sun, 24 Jun 2012 13:47:24 +0000 (21:47 +0800)
committerguibog <guibog@douban.com>
Sun, 24 Jun 2012 13:47:24 +0000 (21:47 +0800)
docs/writing/style.rst

index 0be34fc..4198c27 100644 (file)
@@ -232,6 +232,12 @@ You can use this to swap variables, as well:
 
     a, b = b, a
 
+Nested unpacking works too:
+
+.. code-block:: python
+
+   a, (b, c) = 1, (2, 3)
+
 Create an ignored variable
 ~~~~~~~~~~~~~~~~~~~~~~~~~~