summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/inspect.rst22
1 files changed, 14 insertions, 8 deletions
diff --git a/Doc/library/inspect.rst b/Doc/library/inspect.rst
index bab2c41..9b9bc99 100644
--- a/Doc/library/inspect.rst
+++ b/Doc/library/inspect.rst
@@ -624,15 +624,18 @@ function.
.. attribute:: Signature.parameters
- An ordered mapping of parameters' names to the corresponding
- :class:`Parameter` objects. Parameters appear in strict definition
- order, including keyword-only parameters.
+ An dictionary of :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.
+ .. versionchanged:: 3.9
+ :attr:`parameters` is now of type :class:`dict`. Formerly, it was of
+ type :class:`collections.OrderedDict`.
+
.. attribute:: Signature.return_annotation
The "return" annotation for the callable. If the callable has no "return"
@@ -821,10 +824,9 @@ function.
.. attribute:: BoundArguments.arguments
- An ordered, mutable mapping (:class:`collections.OrderedDict`) of
- parameters' names to arguments' values. Contains only explicitly bound
- arguments. Changes in :attr:`arguments` will reflect in :attr:`args` and
- :attr:`kwargs`.
+ An ordered, mutable mapping of parameters' names to arguments' values.
+ Contains only explicitly bound arguments. Changes in :attr:`arguments`
+ will reflect in :attr:`args` and :attr:`kwargs`.
Should be used in conjunction with :attr:`Signature.parameters` for any
argument processing purposes.
@@ -836,6 +838,10 @@ function.
However, if needed, use :meth:`BoundArguments.apply_defaults` to add
them.
+ .. versionchanged:: 3.9
+ :attr:`arguments` is now of type :class:`dict`. Formerly, it was of
+ type :class:`collections.OrderedDict`.
+
.. attribute:: BoundArguments.args
A tuple of positional arguments values. Dynamically computed from the
@@ -866,7 +872,7 @@ function.
>>> ba = inspect.signature(foo).bind('spam')
>>> ba.apply_defaults()
>>> ba.arguments
- OrderedDict([('a', 'spam'), ('b', 'ham'), ('args', ())])
+ {'a': 'spam', 'b': 'ham', 'args': ()}
.. versionadded:: 3.5