[Python-checkins] r84384 - python/branches/py3k/Doc/library/operator.rst
raymond.hettinger
python-checkins at python.org
Wed Sep 1 09:46:54 CEST 2010
Author: raymond.hettinger
Date: Wed Sep 1 09:46:54 2010
New Revision: 84384
Log:
2-to-3 fixup for map() example in docs
Modified:
python/branches/py3k/Doc/library/operator.rst
Modified: python/branches/py3k/Doc/library/operator.rst
==============================================================================
--- python/branches/py3k/Doc/library/operator.rst (original)
+++ python/branches/py3k/Doc/library/operator.rst Wed Sep 1 09:46:54 2010
@@ -387,7 +387,7 @@
>>> 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)]
More information about the Python-checkins
mailing list