diff options
author | Raymond Hettinger <python@rcn.com> | 2010-04-04 21:45:01 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2010-04-04 21:45:01 (GMT) |
commit | bb006cf26cc41aefcddc8f06722c524826aacefa (patch) | |
tree | 5d0e82402052f188ea868cf94497eba52a7b38fd /Doc/library/functions.rst | |
parent | 4f185228b084ee45ef822198762154457dc343db (diff) | |
download | cpython-bb006cf26cc41aefcddc8f06722c524826aacefa.zip cpython-bb006cf26cc41aefcddc8f06722c524826aacefa.tar.gz cpython-bb006cf26cc41aefcddc8f06722c524826aacefa.tar.bz2 |
Add tests for cmp_to_key.
Adopt PEP 8 compliant function name.
Factor-out existing uses cmp_to_key.
Update documentation to use internal pointers instead of external resource.
Diffstat (limited to 'Doc/library/functions.rst')
-rw-r--r-- | Doc/library/functions.rst | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst index 0f45319..cfb1945 100644 --- a/Doc/library/functions.rst +++ b/Doc/library/functions.rst @@ -1154,9 +1154,8 @@ available. They are listed here in alphabetical order. In general, the *key* and *reverse* conversion processes are much faster than specifying an equivalent *cmp* function. This is because *cmp* is called multiple times for each list element while *key* and *reverse* touch - each element only once. To convert an old-style *cmp* function to a *key* - function, see the `CmpToKey recipe in the ASPN cookbook - <http://code.activestate.com/recipes/576653/>`_\. + each element only once. Use :func:`functools.cmp_to_key` to convert an + old-style *cmp* function to a *key* function. For sorting examples and a brief sorting tutorial, see `Sorting HowTo <http://wiki.python.org/moin/HowTo/Sorting/>`_\. |