]> granicus.if.org Git - python/commitdiff
Doc that 'sorted' args are keyword-only, fix 'reverse' default (#2709)
authorŁukasz Rogalski <rogalski.91@gmail.com>
Fri, 14 Jul 2017 19:57:19 +0000 (21:57 +0200)
committerR. David Murray <rdmurray@bitdance.com>
Fri, 14 Jul 2017 19:57:19 +0000 (15:57 -0400)
backport

Doc/library/functions.rst
Doc/library/stdtypes.rst

index 6621f4aabf705877ff20b655fe9b7c81509249d0..916e3528d79dac00371c1c549b43641fa71b89ec 100644 (file)
@@ -1319,7 +1319,7 @@ are always available.  They are listed here in alphabetical order.
    :func:`itertools.islice` for an alternate version that returns an iterator.
 
 
-.. function:: sorted(iterable[, key][, reverse])
+.. function:: sorted(iterable, *, key=None, reverse=False)
 
    Return a new sorted list from the items in *iterable*.
 
index 5ab8177490d6ce2e56408f00477897f58942e4c2..e929f0b68767d47a80487f8532689ad024db597c 100644 (file)
@@ -1161,7 +1161,7 @@ application).
    :ref:`mutable <typesseq-mutable>` sequence operations. Lists also provide the
    following additional method:
 
-   .. method:: list.sort(*, key=None, reverse=None)
+   .. method:: list.sort(*, key=None, reverse=False)
 
       This method sorts the list in place, using only ``<`` comparisons
       between items. Exceptions are not suppressed - if any comparison operations