There was an error while loading. Please reload this page.
1 parent 20933e0 commit d292a17Copy full SHA for d292a17
1 file changed
Doc/library/operator.rst
@@ -387,7 +387,7 @@ expect a function argument.
387
388
>>> inventory = [('apple', 3), ('banana', 2), ('pear', 5), ('orange', 1)]
389
>>> getcount = itemgetter(1)
390
- >>> map(getcount, inventory)
+ >>> list(map(getcount, inventory))
391
[3, 2, 5, 1]
392
>>> sorted(inventory, key=getcount)
393
[('orange', 1), ('banana', 2), ('apple', 3), ('pear', 5)]
0 commit comments