From: Raymond Hettinger Date: Wed, 1 Sep 2010 08:27:16 +0000 (+0000) Subject: Fixup broken example X-Git-Tag: v3.1.3rc1~295 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=293ffcf89d3cc7df7d0897fabace49e0d0056a1d;p=thirdparty%2FPython%2Fcpython.git Fixup broken example --- diff --git a/Doc/library/operator.rst b/Doc/library/operator.rst index 597be9d43167..2d030615cc3b 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)]