]> granicus.if.org Git - python/commitdiff
zip() returns an iterator, make a list() of it; thanks to Martin from docs@
authorSandro Tosi <sandro.tosi@gmail.com>
Sun, 12 Aug 2012 08:24:50 +0000 (10:24 +0200)
committerSandro Tosi <sandro.tosi@gmail.com>
Sun, 12 Aug 2012 08:24:50 +0000 (10:24 +0200)
Doc/tutorial/datastructures.rst

index eec34f0df51186bd984f981b8cfc1a4935b2124c..7ec044c50d11bbb2e2097c02516ccdc42a79ea98 100644 (file)
@@ -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.