Issue #1771: Remove cmp parameter from list.sort() and builtin.sorted().
diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst
index 0126831..afa9198 100644
--- a/Doc/library/functions.rst
+++ b/Doc/library/functions.rst
@@ -959,31 +959,20 @@
``a[start:stop:step]`` or ``a[start:stop, i]``.
-.. function:: sorted(iterable[, cmp[, key[, reverse]]])
+.. function:: sorted(iterable[, key[, reverse]])
Return a new sorted list from the items in *iterable*.
- The optional arguments *cmp*, *key*, and *reverse* have the same meaning as
+ The optional arguments *key* and *reverse* have the same meaning as
those for the :meth:`list.sort` method (described in section
:ref:`typesseq-mutable`).
- *cmp* specifies a custom comparison function of two arguments (iterable
- elements) which should return a negative, zero or positive number depending on
- whether the first argument is considered smaller than, equal to, or larger than
- the second argument: ``cmp=lambda x,y: cmp(x.lower(), y.lower())``. The default
- value is ``None``.
-
*key* specifies a function of one argument that is used to extract a comparison
key from each list element: ``key=str.lower``. The default value is ``None``.
*reverse* is a boolean value. If set to ``True``, then the list elements are
sorted as if each comparison were reversed.
- 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.
-
.. function:: staticmethod(function)
diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst
index 22ca0f0..6a2be28 100644
--- a/Doc/library/stdtypes.rst
+++ b/Doc/library/stdtypes.rst
@@ -1266,8 +1266,7 @@
| ``s.reverse()`` | reverses the items of *s* in | \(6) |
| | place | |
+------------------------------+--------------------------------+---------------------+
-| ``s.sort([cmp[, key[, | sort the items of *s* in place | (6), (7) |
-| reverse]]])`` | | |
+| ``s.sort([key[, reverse]])`` | sort the items of *s* in place | (6), (7) |
+------------------------------+--------------------------------+---------------------+
.. index::
@@ -1321,23 +1320,12 @@
The :meth:`sort` method takes optional arguments for controlling the
comparisons.
- *cmp* specifies a custom comparison function of two arguments (list items) which
- should return a negative, zero or positive number depending on whether the first
- argument is considered smaller than, equal to, or larger than the second
- argument: ``cmp=lambda x,y: cmp(x.lower(), y.lower())``. The default value
- is ``None``.
-
*key* specifies a function of one argument that is used to extract a comparison
key from each list element: ``key=str.lower``. The default value is ``None``.
*reverse* is a boolean value. If set to ``True``, then the list elements are
sorted as if each comparison were reversed.
- 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.
-
Starting with Python 2.3, the :meth:`sort` method is guaranteed to be stable. A
sort is stable if it guarantees not to change the relative order of elements
that compare equal --- this is helpful for sorting in multiple passes (for