mirror of
https://github.com/python/cpython.git
synced 2025-09-29 19:56:59 +00:00
Doc that 'sorted' args are keyword-only, fix 'reverse' default (#2709)
backport
This commit is contained in:
parent
1aafd9c8bd
commit
ea9cbe0a5c
2 changed files with 2 additions and 2 deletions
|
@ -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*.
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue