]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Guido grants a Christmas wish:
authorRaymond Hettinger <python@rcn.com>
Wed, 17 Dec 2003 20:50:46 +0000 (20:50 +0000)
committerRaymond Hettinger <python@rcn.com>
Wed, 17 Dec 2003 20:50:46 +0000 (20:50 +0000)
  sorted() becomes a regular function instead of a classmethod.

Doc/lib/liboperator.tex

index ab68d0e01f5a47eae9f149cadaf1eba7a9fbd3e8..2d46b4d22e30e2b0e47445df3c0af29f63ea82a2 100644 (file)
@@ -302,7 +302,7 @@ Example: Build a dictionary that maps the ordinals from \code{0} to
 
 The \module{operator} module also defines tools for generalized attribute
 and item lookups.  These are useful for making fast field extractors
-as arguments for \function{map()}, \method{list.sort()},
+as arguments for \function{map()}, \function{sorted()},
 \method{itertools.groupby()}, or other functions that expect a
 function argument.
 
@@ -328,7 +328,7 @@ Examples:
 >>> getcount = itemgetter(1)
 >>> map(getcount, inventory)
 [3, 2, 5, 1]
->>> list.sorted(inventory, key=getcount)
+>>> sorted(inventory, key=getcount)
 [('orange', 1), ('banana', 2), ('apple', 3), ('pear', 5)]
 \end{verbatim}