summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSandro Tosi <sandro.tosi@gmail.com>2012-08-12 08:24:50 (GMT)
committerSandro Tosi <sandro.tosi@gmail.com>2012-08-12 08:24:50 (GMT)
commit0a90a82b8a9e4364eb669dee250e308aeaa40f4a (patch)
tree3a920f99b15fb88b6bb3a65e6dc4d20f570c4779
parentfbd4f80979c26f0cf6a3a8af9d8e4131cfeab5a7 (diff)
downloadcpython-0a90a82b8a9e4364eb669dee250e308aeaa40f4a.zip
cpython-0a90a82b8a9e4364eb669dee250e308aeaa40f4a.tar.gz
cpython-0a90a82b8a9e4364eb669dee250e308aeaa40f4a.tar.bz2
zip() returns an iterator, make a list() of it; thanks to Martin from docs@
-rw-r--r--Doc/tutorial/datastructures.rst2
1 files changed, 1 insertions, 1 deletions
diff --git a/Doc/tutorial/datastructures.rst b/Doc/tutorial/datastructures.rst
index eec34f0..7ec044c 100644
--- a/Doc/tutorial/datastructures.rst
+++ b/Doc/tutorial/datastructures.rst
@@ -292,7 +292,7 @@ which, in turn, is the same as::
In the real world, you should prefer built-in functions to complex flow statements.
The :func:`zip` function would do a great job for this use case::
- >>> zip(*matrix)
+ >>> list(zip(*matrix))
[(1, 5, 9), (2, 6, 10), (3, 7, 11), (4, 8, 12)]
See :ref:`tut-unpacking-arguments` for details on the asterisk in this line.