diff options
| author | Raymond Hettinger <python@rcn.com> | 2003-12-17 20:50:46 +0000 |
|---|---|---|
| committer | Raymond Hettinger <python@rcn.com> | 2003-12-17 20:50:46 +0000 |
| commit | b606b3d08af3cc15e880650bab3c773131c4ec66 (patch) | |
| tree | db0f941c7e43249a1bf24e23df0fdf5aec3c8831 /Doc/lib/liboperator.tex | |
| parent | e708fbd2867ddcdc690930869cbf73e964f452c1 (diff) | |
| download | cpython-git-b606b3d08af3cc15e880650bab3c773131c4ec66.tar.gz | |
Guido grants a Christmas wish:
sorted() becomes a regular function instead of a classmethod.
Diffstat (limited to 'Doc/lib/liboperator.tex')
| -rw-r--r-- | Doc/lib/liboperator.tex | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Doc/lib/liboperator.tex b/Doc/lib/liboperator.tex index ab68d0e01f..2d46b4d22e 100644 --- a/Doc/lib/liboperator.tex +++ b/Doc/lib/liboperator.tex @@ -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} |
