diff options
author | Éric Araujo <merwok@netwok.org> | 2011-05-25 18:06:35 +0200 |
---|---|---|
committer | Éric Araujo <merwok@netwok.org> | 2011-05-25 18:06:35 +0200 |
commit | de32c4b97caa7e4b70b81c18da3fa693bebb952d (patch) | |
tree | b771908fe89fc117032c503fa3e37c5f893bdb75 /Doc/glossary.rst | |
parent | 1c814933dad1bea8eff9fbb8c39064d6de379a8d (diff) | |
parent | 3db5f1d86143ce3b24f187b170b19fe639af000c (diff) | |
download | cpython-de32c4b97caa7e4b70b81c18da3fa693bebb952d.tar.gz |
Branch merge
Diffstat (limited to 'Doc/glossary.rst')
-rw-r--r-- | Doc/glossary.rst | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/Doc/glossary.rst b/Doc/glossary.rst index 782263460e..fa811442c2 100644 --- a/Doc/glossary.rst +++ b/Doc/glossary.rst @@ -392,26 +392,6 @@ Glossary value is assigned. ``**`` is used to accept or pass a dictionary of keyword arguments. See :term:`argument`. - key function - A key function or collation function is a callable that returns a value - used for sorting or ordering. For example, :func:`locale.strxfrm` is - used to produce a sort key that is aware of locale specific sort - conventions. - - A number of tools in Python accept key functions to control how elements - are ordered or grouped. They include :func:`min`, :func:`max`, - :func:`sorted`, :meth:`list.sort`, :func:`heapq.nsmallest`, - :func:`heapq.nlargest`, and :func:`itertools.groupby`. - - There are several ways to create a key function. For example. the - :meth:`str.lower` method can serve as a key function for case insensitive - sorts. Alternatively, an ad-hoc key function can be built from a - :keyword:`lambda` expression such as ``lambda r: (r[0], r[2])``. Also, - the :mod:`operator` module provides three key function constuctors: - :func:`~operator.attrgetter`, :func:`~operator.itemgetter`, and - :func:`~operator.methodcaller`. See the :ref:`sortinghowto` for - examples of how to create and use key functions. - lambda An anonymous inline function consisting of a single :term:`expression` which is evaluated when the function is called. The syntax to create |