[Python-checkins] r83872 - python/branches/py3k/Doc/library/functools.rst
benjamin.peterson
python-checkins at python.org
Mon Aug 9 04:13:10 CEST 2010
Author: benjamin.peterson
Date: Mon Aug 9 04:13:10 2010
New Revision: 83872
Log:
use 3 space indents
Modified:
python/branches/py3k/Doc/library/functools.rst
Modified: python/branches/py3k/Doc/library/functools.rst
==============================================================================
--- python/branches/py3k/Doc/library/functools.rst (original)
+++ python/branches/py3k/Doc/library/functools.rst Mon Aug 9 04:13:10 2010
@@ -17,23 +17,22 @@
.. function:: cmp_to_key(func)
- Transform an old-style comparison function to a key-function. Used with
- tools that accept key functions (such as :func:`sorted`, :func:`min`,
- :func:`max`, :func:`heapq.nlargest`, :func:`heapq.nsmallest`,
- :func:`itertools.groupby`).
- This function is primarily used as a transition tool for programs
- being converted from Py2.x which supported the use of comparison
- functions.
-
- A compare function is any callable that accept two arguments, compares
- them, and returns a negative number for less-than, zero for equality,
- or a positive number for greater-than. A key function is a callable
- that accepts one argument and returns another value that indicates
- the position in the desired collation sequence.
+ Transform an old-style comparison function to a key-function. Used with
+ tools that accept key functions (such as :func:`sorted`, :func:`min`,
+ :func:`max`, :func:`heapq.nlargest`, :func:`heapq.nsmallest`,
+ :func:`itertools.groupby`). This function is primarily used as a transition
+ tool for programs being converted from Py2.x which supported the use of
+ comparison functions.
+
+ A compare function is any callable that accept two arguments, compares them,
+ and returns a negative number for less-than, zero for equality, or a positive
+ number for greater-than. A key function is a callable that accepts one
+ argument and returns another value that indicates the position in the desired
+ collation sequence.
- Example::
+ Example::
- sorted(iterable, key=cmp_to_key(locale.strcoll)) # locale-aware sort order
+ sorted(iterable, key=cmp_to_key(locale.strcoll)) # locale-aware sort order
.. versionadded:: 3.2
More information about the Python-checkins
mailing list