From 0a90a82b8a9e4364eb669dee250e308aeaa40f4a Mon Sep 17 00:00:00 2001 From: Sandro Tosi Date: Sun, 12 Aug 2012 10:24:50 +0200 Subject: [PATCH] zip() returns an iterator, make a list() of it; thanks to Martin from docs@ --- Doc/tutorial/datastructures.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/tutorial/datastructures.rst b/Doc/tutorial/datastructures.rst index eec34f0df51..7ec044c50d1 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.