summaryrefslogtreecommitdiffstats
path: root/Doc/glossary.rst
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2010-11-05 07:11:47 (GMT)
committerGeorg Brandl <georg@python.org>2010-11-05 07:11:47 (GMT)
commiteae40ba6f71f55e7e597c2663454a7e164a767fe (patch)
tree686acb5c95381c35f6a51d0c45e6121e08f651ac /Doc/glossary.rst
parent34b3e59504065800a3f3ae81c7d84e34124b5ef6 (diff)
downloadcpython-eae40ba6f71f55e7e597c2663454a7e164a767fe.zip
cpython-eae40ba6f71f55e7e597c2663454a7e164a767fe.tar.gz
cpython-eae40ba6f71f55e7e597c2663454a7e164a767fe.tar.bz2
Merged revisions 86187 via svnmerge from
svn+ssh://svn.python.org/python/branches/py3k ........ r86187 | georg.brandl | 2010-11-05 07:10:41 +0000 (Fr, 05 Nov 2010) | 1 line Move glossary entry to the right position and fix link. ........
Diffstat (limited to 'Doc/glossary.rst')
-rw-r--r--Doc/glossary.rst40
1 files changed, 20 insertions, 20 deletions
diff --git a/Doc/glossary.rst b/Doc/glossary.rst
index 70a0680..377f678 100644
--- a/Doc/glossary.rst
+++ b/Doc/glossary.rst
@@ -283,26 +283,6 @@ Glossary
instances of user-defined classes are hashable by default; they all
compare unequal, and their hash value is their :func:`id`.
- 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:`Sorting HOW TO` for
- examples of how to create and use key functions.
-
IDLE
An Integrated Development Environment for Python. IDLE is a basic editor
and interpreter environment which ships with the standard distribution of
@@ -370,6 +350,26 @@ Glossary
More information can be found in :ref:`typeiter`.
+ 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:`Sorting HOW TO
+ <sortinghowto>` for examples of how to create and use key functions.
+
keyword argument
Arguments which are preceded with a ``variable_name=`` in the call.
The variable name designates the local name in the function to which the