This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: bpo39775 not fixed - inspect.Signature.parameters still dict/mappingproxy around dict
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.9
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: gelbpunkt, methane
Priority: normal Keywords: patch

Created on 2020-03-13 19:24 by gelbpunkt, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 18988 merged gelbpunkt, 2020-03-14 09:52
Messages (4)
msg364118 - (view) Author: Jens Reidel (gelbpunkt) * Date: 2020-03-13 19:24
Hi guys,

compiling CPython from the master branch will result in a git history with the commit https://github.com/python/cpython/commit/211055176157545ce98e6c02b09d624719e6dd30 included and in Lib/inspect.py, however the return type is still like before and behaviour has not changed.

    Python 3.9.0a4+ (heads/master:be79373a78, Mar 11 2020, 16:36:27) 
    [GCC 9.2.1 20190827 (Red Hat 9.2.1-1)] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import inspect
    >>> inspect.signature(lambda x, y: None).parameters == inspect.signature(lambda y, x: None).parameters
    True
    >>> 

I have been able to confirm this on all builds I've done. To get it to do expected behaviour and return False on above code, I need to patch back the commit that changed OrderedDict to dict (https://raw.githubusercontent.com/Gelbpunkt/python-image/master/inspect.patch is the file I am using to patch). I have compiled against the codebase of https://github.com/python/cpython/commit/be79373a78c0d75fc715ab64253c9b757987a848 and believe this is some issue with the Lib/inspect.py code internally if the patch file can fix it.
msg364119 - (view) Author: Jens Reidel (gelbpunkt) * Date: 2020-03-13 19:27
Just to show the types are inequal:

Without patch file:

    >>> inspect.signature(lambda x: None).parameters
    mappingproxy({'x': <Parameter "x">})

With patch file:

    >>> inspect.signature(lambda x: None).parameters
    mappingproxy(OrderedDict([('x', <Parameter "x">)]))
msg364135 - (view) Author: Inada Naoki (methane) * (Python committer) Date: 2020-03-14 01:33
Would you create a pull request?
msg364497 - (view) Author: Inada Naoki (methane) * (Python committer) Date: 2020-03-18 02:22
New changeset 611836a69a7a98bb106b4d315ed76a1e17266f4f by Jens Reidel in branch 'master':
bpo-39957: Change Signature.parameters to OrderedDict (GH-18988)
https://github.com/python/cpython/commit/611836a69a7a98bb106b4d315ed76a1e17266f4f
History
Date User Action Args
2022-04-11 14:59:28adminsetgithub: 84138
2020-03-18 02:23:05methanesetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2020-03-18 02:22:49methanesetmessages: + msg364497
2020-03-14 09:52:23gelbpunktsetkeywords: + patch
stage: patch review
pull_requests: + pull_request18335
2020-03-14 01:33:39methanesetmessages: + msg364135
2020-03-13 19:35:52xtreaksetnosy: + methane
2020-03-13 19:27:29gelbpunktsetmessages: + msg364119
2020-03-13 19:26:36gelbpunktsettitle: bpo39775 not fixed - inspect.Signature.parameters still dict/mappingproxy -> bpo39775 not fixed - inspect.Signature.parameters still dict/mappingproxy around dict
2020-03-13 19:24:43gelbpunktcreate