]> granicus.if.org Git - python/commitdiff
2-to-3 fixup for map() example in docs
authorRaymond Hettinger <python@rcn.com>
Wed, 1 Sep 2010 07:46:54 +0000 (07:46 +0000)
committerRaymond Hettinger <python@rcn.com>
Wed, 1 Sep 2010 07:46:54 +0000 (07:46 +0000)
Doc/library/operator.rst

index 597be9d431673c92297cb7f7507597a6462ffcab..2d030615cc3ba5d35da7c2e32b1e48f221b6b68f 100644 (file)
@@ -387,7 +387,7 @@ expect a function argument.
 
       >>> inventory = [('apple', 3), ('banana', 2), ('pear', 5), ('orange', 1)]
       >>> getcount = itemgetter(1)
-      >>> map(getcount, inventory)
+      >>> list(map(getcount, inventory))
       [3, 2, 5, 1]
       >>> sorted(inventory, key=getcount)
       [('orange', 1), ('banana', 2), ('apple', 3), ('pear', 5)]