From d292a17fc7ee36d0f815ece18f48122587ec91fe Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Wed, 1 Sep 2010 07:46:54 +0000 Subject: [PATCH] 2-to-3 fixup for map() example in docs --- Doc/library/operator.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/operator.rst b/Doc/library/operator.rst index 597be9d431..2d030615cc 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)] -- 2.40.0