summaryrefslogtreecommitdiffstats
path: root/Doc/library/inspect.rst
diff options
context:
space:
mode:
authorlarryhastings <larry@hastings.org>2018-01-28 19:13:09 (GMT)
committerGitHub <noreply@github.com>2018-01-28 19:13:09 (GMT)
commitf36ba12809d5db1b76464d8f1f04dad8d685ec78 (patch)
tree62de617e1bd3fc4609e1f95338755887db22f4b5 /Doc/library/inspect.rst
parentbec2372b7e1da5dfdbadaf242aa8e994b164cace (diff)
downloadcpython-f36ba12809d5db1b76464d8f1f04dad8d685ec78.zip
cpython-f36ba12809d5db1b76464d8f1f04dad8d685ec78.tar.gz
cpython-f36ba12809d5db1b76464d8f1f04dad8d685ec78.tar.bz2
bpo-32697: Definition order of kwonly params is now guaranteed preserved. (#5391)
Definition order of kwonly params is now guaranteed preserved.
Diffstat (limited to 'Doc/library/inspect.rst')
-rw-r--r--Doc/library/inspect.rst15
1 files changed, 13 insertions, 2 deletions
diff --git a/Doc/library/inspect.rst b/Doc/library/inspect.rst
index 147e802..bc4316f 100644
--- a/Doc/library/inspect.rst
+++ b/Doc/library/inspect.rst
@@ -602,7 +602,13 @@ function.
.. attribute:: Signature.parameters
An ordered mapping of parameters' names to the corresponding
- :class:`Parameter` objects.
+ :class:`Parameter` objects. Parameters appear in strict definition
+ order, including keyword-only parameters.
+
+ .. versionchanged:: 3.7
+ Python only explicitly guaranteed that it preserved the declaration
+ order of keyword-only parameters as of version 3.7, although in practice
+ this order had always been preserved in Python 3.
.. attribute:: Signature.return_annotation
@@ -895,7 +901,7 @@ Classes and functions
*defaults* is an *n*-tuple of default argument values corresponding to the
last *n* positional parameters, or ``None`` if there are no such defaults
defined.
- *kwonlyargs* is a list of keyword-only parameter names.
+ *kwonlyargs* is a list of keyword-only parameter names in declaration order.
*kwonlydefaults* is a dictionary mapping parameter names from *kwonlyargs*
to the default values used if no argument is supplied.
*annotations* is a dictionary mapping parameter names to annotations.
@@ -921,6 +927,11 @@ Classes and functions
single-source Python 2/3 code migrating away from the legacy
:func:`getargspec` API.
+ .. versionchanged:: 3.7
+ Python only explicitly guaranteed that it preserved the declaration
+ order of keyword-only parameters as of version 3.7, although in practice
+ this order had always been preserved in Python 3.
+
.. function:: getargvalues(frame)