From: Ɓukasz Rogalski Date: Fri, 14 Jul 2017 19:23:39 +0000 (+0200) Subject: Doc that 'sorted' args are keyword-only, fix 'reverse' default (#2706) X-Git-Tag: v3.7.0a1~419 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=be37beb05f5f2cff18e41440453e79aa17b239f9;p=thirdparty%2FPython%2Fcpython.git Doc that 'sorted' args are keyword-only, fix 'reverse' default (#2706) --- diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst index 4e48e4267f64..015231d9cff2 100644 --- a/Doc/library/functions.rst +++ b/Doc/library/functions.rst @@ -1361,7 +1361,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*. diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index e0691c7dcf87..564579e70c5d 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -1161,7 +1161,7 @@ application). :ref:`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