Issue 36350: inspect.Signature.parameters and inspect.BoundArguments.arguments should be dicts instead of OrderedDicts (original) (raw)

Issue36350

Created on 2019-03-18 15:16 by remi.lapeyre, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 12412 merged remi.lapeyre,2019-03-18 15:19
Messages (3)
msg338238 - (view) Author: Rémi Lapeyre (remi.lapeyre) * Date: 2019-03-18 15:16
Python 3.7.2 (default, Feb 12 2019, 08:15:36) [Clang 10.0.0 (clang-1000.11.45.5)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import inspect >>> inspect.Signature().parameters mappingproxy(OrderedDict()) >>> def foo(a): pass ... >>> ba = inspect.signature(foo).bind(1) >>> ba.arguments OrderedDict([('a', 1)])
msg360718 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2020-01-26 04:50
I'm neutral on whether to move this forward or not. Usually, we would only make an externally visible and possibly consequential API change if there were some compensating benefit to users (a significant speed-up for example). Also note that the existing code uses move_to_end() so there is some case to be made that OrderedDict() was a reasonable choice even if dict() had been an option from the outset. I suggest leaving this as-is.
msg360868 - (view) Author: Inada Naoki (methane) * (Python committer) Date: 2020-01-28 12:47
New changeset 2cca8efe46935c39c445f585bce54954fad2485b by Inada Naoki (Rémi Lapeyre) in branch 'master': bpo-36350: inspect: Replace OrderedDict with dict. (GH-12412) https://github.com/python/cpython/commit/2cca8efe46935c39c445f585bce54954fad2485b
History
Date User Action Args
2022-04-11 14:59:12 admin set github: 80531
2020-01-28 12:47:27 methane set status: open -> closedversions: + Python 3.9, - Python 3.8nosy: - methaneresolution: fixedstage: patch review -> resolved
2020-01-28 12:47:22 methane set nosy: + methanemessages: +
2020-01-26 04:50:10 rhettinger set nosy: + rhettingermessages: +
2019-03-18 15:20:38 xtreak set nosy: + yselivanov
2019-03-18 15:19:23 remi.lapeyre set keywords: + patchstage: patch reviewpull_requests: + <pull%5Frequest12366>
2019-03-18 15:16:48 remi.lapeyre create