summaryrefslogtreecommitdiffstats
path: root/Doc/library/inspect.rst
diff options
context:
space:
mode:
authorRĂ©mi Lapeyre <remi.lapeyre@henki.fr>2020-01-28 12:47:03 (GMT)
committerInada Naoki <songofacandy@gmail.com>2020-01-28 12:47:03 (GMT)
commit2cca8efe46935c39c445f585bce54954fad2485b (patch)
treef1742035d30478e763ef671189e66fbb64381049 /Doc/library/inspect.rst
parent0be3246d4f9c8eddcd55491901d95b09fe163f15 (diff)
downloadcpython-2cca8efe46935c39c445f585bce54954fad2485b.zip
cpython-2cca8efe46935c39c445f585bce54954fad2485b.tar.gz
cpython-2cca8efe46935c39c445f585bce54954fad2485b.tar.bz2
bpo-36350: inspect: Replace OrderedDict with dict. (GH-12412)
Diffstat (limited to 'Doc/library/inspect.rst')
-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