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/functions.rst b/Doc/library/functions.rst
index 0f45319..cfb1945 100644
--- a/Doc/library/functions.rst
+++ b/Doc/library/functions.rst
@@ -1154,9 +1154,8 @@
    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.  To convert an old-style *cmp* function to a *key*
-   function, see the `CmpToKey recipe in the ASPN cookbook
-   <http://code.activestate.com/recipes/576653/>`_\.
+   each element only once.  Use :func:`functools.cmp_to_key` to convert an
+   old-style *cmp* function to a *key* function.
 
    For sorting examples and a brief sorting tutorial, see `Sorting HowTo
    <http://wiki.python.org/moin/HowTo/Sorting/>`_\.
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
 
diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst
index 3307685..0a6178b 100644
--- a/Doc/library/stdtypes.rst
+++ b/Doc/library/stdtypes.rst
@@ -1618,7 +1618,8 @@
    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.
+   element only once.  Use :func:`functools.cmp_to_key` to convert an
+   old-style *cmp* function to a *key* function.
 
    .. versionchanged:: 2.3
       Support for ``None`` as an equivalent to omitting *cmp* was added.