diff --git a/Doc/library/inspect.rst b/Doc/library/inspect.rst --- a/Doc/library/inspect.rst +++ b/Doc/library/inspect.rst @@ -652,10 +652,9 @@ .. 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`. + A 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. diff --git a/Lib/inspect.py b/Lib/inspect.py --- a/Lib/inspect.py +++ b/Lib/inspect.py @@ -2265,8 +2265,8 @@ Has the following public attributes: - * arguments : OrderedDict - An ordered mutable mapping of parameters' names to arguments' values. + * arguments : dict + A mutable mapping of parameters' names to arguments' values. Does not contain arguments' default values. * signature : Signature The Signature object that created this instance. @@ -2565,7 +2565,7 @@ def _bind(self, args, kwargs, *, partial=False): """Private method. Don't use directly.""" - arguments = OrderedDict() + arguments = {} parameters = iter(self.parameters.values()) parameters_ex = () diff --git a/Lib/test/test_inspect.py b/Lib/test/test_inspect.py --- a/Lib/test/test_inspect.py +++ b/Lib/test/test_inspect.py @@ -2997,9 +2997,9 @@ ba = sig.bind(10, 20, b=30, c=40, args=50, kwargs=60) # we won't have 'z' argument in the bound arguments object, as we didn't # pass it to the 'bind' - self.assertEqual(tuple(ba.arguments.items()), - (('a', 10), ('args', (20,)), ('b', 30), - ('kwargs', {'c': 40, 'args': 50, 'kwargs': 60}))) + self.assertEqual(ba.arguments, + {'a': 10, 'args': (20,), 'b': 30, + 'kwargs': {'c': 40, 'args': 50, 'kwargs': 60}}) self.assertEqual(ba.kwargs, {'b': 30, 'c': 40, 'args': 50, 'kwargs': 60}) self.assertEqual(ba.args, (10, 20))