Skip to content

Commit ea9cbe0

Browse files
rogalskibitdancer
authored andcommitted
Doc that 'sorted' args are keyword-only, fix 'reverse' default (#2709)
backport
1 parent 1aafd9c commit ea9cbe0

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Doc/library/functions.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1319,7 +1319,7 @@ are always available. They are listed here in alphabetical order.
13191319
:func:`itertools.islice` for an alternate version that returns an iterator.
13201320

13211321

1322-
.. function:: sorted(iterable[, key][, reverse])
1322+
.. function:: sorted(iterable, *, key=None, reverse=False)
13231323

13241324
Return a new sorted list from the items in *iterable*.
13251325

Doc/library/stdtypes.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1161,7 +1161,7 @@ application).
11611161
:ref:`mutable <typesseq-mutable>` sequence operations. Lists also provide the
11621162
following additional method:
11631163

1164-
.. method:: list.sort(*, key=None, reverse=None)
1164+
.. method:: list.sort(*, key=None, reverse=False)
11651165

11661166
This method sorts the list in place, using only ``<`` comparisons
11671167
between items. Exceptions are not suppressed - if any comparison operations

0 commit comments

Comments
 (0)