]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
#4562: fix zip() examples.
authorGeorg Brandl <georg@python.org>
Sat, 6 Dec 2008 14:28:56 +0000 (14:28 +0000)
committerGeorg Brandl <georg@python.org>
Sat, 6 Dec 2008 14:28:56 +0000 (14:28 +0000)
Doc/library/functions.rst

index 916db6da60140fa11ca7368cea403f11cced7d6f..364d9de76bdc29330a4502cbffa2b9b9f7bf9344 100644 (file)
@@ -1161,9 +1161,9 @@ are always available.  They are listed here in alphabetical order.
       >>> x = [1, 2, 3]
       >>> y = [4, 5, 6]
       >>> zipped = zip(x, y)
-      >>> zipped
+      >>> list(zipped)
       [(1, 4), (2, 5), (3, 6)]
-      >>> x2, y2 = zip(*zipped)
+      >>> x2, y2 = zip(*zip(x, y))
       >>> x == x2, y == y2
       True