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.
diff --git a/Doc/library/functools.rst b/Doc/library/functools.rst
index 3337ead..15c4a95 100644
--- a/Doc/library/functools.rst
+++ b/Doc/library/functools.rst
@@ -17,7 +17,7 @@
The :mod:`functools` module defines the following functions:
-.. function:: CmpToKey(func)
+.. 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`,
@@ -35,7 +35,7 @@
Example::
- sorted(iterable, key=CmpToKey(locale.strcoll)) # locale-aware sort order
+ sorted(iterable, key=cmp_to_key(locale.strcoll)) # locale-aware sort order
.. versionadded:: 2.7