fix dangling keyfunc examples in documentation of heapq and sorted (GH-1432)

* fix dangling mention of key=str.lower in heapq doc

* Fix dangling mention of keyfunc example for sorted()
(cherry picked from commit 6bdb6f7675922e601e742758c7c240a751fd365b)

Co-authored-by: Wolfgang Maier <wolfgang.maier@biologie.uni-freiburg.de>
diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst
index bb47286..c0f4ffd 100644
--- a/Doc/library/functions.rst
+++ b/Doc/library/functions.rst
@@ -1405,8 +1405,8 @@
    Has two optional arguments which must be specified as keyword arguments.
 
    *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``
-   (compare the elements directly).
+   key from each element in *iterable* (for example, ``key=str.lower``).  The
+   default value is ``None`` (compare the elements directly).
 
    *reverse* is a boolean value.  If set to ``True``, then the list elements are
    sorted as if each comparison were reversed.