diff options
author | Wolfgang Maier <wolfgang.maier@biologie.uni-freiburg.de> | 2018-10-15 19:06:53 (GMT) |
---|---|---|
committer | Brian Curtin <brian@python.org> | 2018-10-15 19:06:53 (GMT) |
commit | 6bdb6f7675922e601e742758c7c240a751fd365b (patch) | |
tree | 2db52433eee8ae3408179a41dc78749a7931b5b2 /Doc/library/heapq.rst | |
parent | 18fb1fb943b7dbd7f8a76017ee2a67ef13effb85 (diff) | |
download | cpython-6bdb6f7675922e601e742758c7c240a751fd365b.zip cpython-6bdb6f7675922e601e742758c7c240a751fd365b.tar.gz cpython-6bdb6f7675922e601e742758c7c240a751fd365b.tar.bz2 |
fix dangling keyfunc examples in documentation of heapq and sorted (#1432)
* fix dangling mention of key=str.lower in heapq doc
* Fix dangling mention of keyfunc example for sorted()
Diffstat (limited to 'Doc/library/heapq.rst')
-rw-r--r-- | Doc/library/heapq.rst | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Doc/library/heapq.rst b/Doc/library/heapq.rst index 0b1a3c8..8b00f7b 100644 --- a/Doc/library/heapq.rst +++ b/Doc/library/heapq.rst @@ -112,17 +112,17 @@ The module also offers three general purpose functions based on heaps. Return a list with the *n* largest elements from the dataset defined by *iterable*. *key*, if provided, specifies a function of one argument that is - used to extract a comparison key from each element in the iterable: - ``key=str.lower`` Equivalent to: ``sorted(iterable, key=key, - reverse=True)[:n]`` + used to extract a comparison key from each element in *iterable* (for example, + ``key=str.lower``). Equivalent to: ``sorted(iterable, key=key, + reverse=True)[:n]``. .. function:: nsmallest(n, iterable, key=None) Return a list with the *n* smallest elements from the dataset defined by *iterable*. *key*, if provided, specifies a function of one argument that is - used to extract a comparison key from each element in the iterable: - ``key=str.lower`` Equivalent to: ``sorted(iterable, key=key)[:n]`` + used to extract a comparison key from each element in *iterable* (for example, + ``key=str.lower``). Equivalent to: ``sorted(iterable, key=key)[:n]``. The latter two functions perform best for smaller values of *n*. For larger |