diff options
author | Raymond Hettinger <python@rcn.com> | 2010-09-01 07:46:54 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2010-09-01 07:46:54 (GMT) |
commit | d292a17fc7ee36d0f815ece18f48122587ec91fe (patch) | |
tree | c440619172d1948cb3507e96deea651231c93e78 /Doc | |
parent | 20933e08b12b4e66c6e1baf662a679b4008d9dce (diff) | |
download | cpython-d292a17fc7ee36d0f815ece18f48122587ec91fe.zip cpython-d292a17fc7ee36d0f815ece18f48122587ec91fe.tar.gz cpython-d292a17fc7ee36d0f815ece18f48122587ec91fe.tar.bz2 |
2-to-3 fixup for map() example in docs
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/operator.rst | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Doc/library/operator.rst b/Doc/library/operator.rst index 597be9d..2d03061 100644 --- a/Doc/library/operator.rst +++ b/Doc/library/operator.rst @@ -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)] |