Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inspect.Signature.parameters and inspect.BoundArguments.arguments should be dicts instead of OrderedDicts #80531

Closed
remilapeyre mannequin opened this issue Mar 18, 2019 · 3 comments
Labels
3.9 only security fixes stdlib Python modules in the Lib dir type-feature A feature request or enhancement

Comments

@remilapeyre
Copy link
Mannequin

remilapeyre mannequin commented Mar 18, 2019

BPO 36350
Nosy @rhettinger, @1st1, @remilapeyre
PRs
  • bpo-36350: inspect: Replace OrderedDict with dict. #12412
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2020-01-28.12:47:27.904>
    created_at = <Date 2019-03-18.15:16:48.913>
    labels = ['type-feature', 'library', '3.9']
    title = 'inspect.Signature.parameters and inspect.BoundArguments.arguments should be dicts instead of OrderedDicts'
    updated_at = <Date 2020-01-28.12:47:27.899>
    user = 'https://github.com/remilapeyre'

    bugs.python.org fields:

    activity = <Date 2020-01-28.12:47:27.899>
    actor = 'methane'
    assignee = 'none'
    closed = True
    closed_date = <Date 2020-01-28.12:47:27.904>
    closer = 'methane'
    components = ['Library (Lib)']
    creation = <Date 2019-03-18.15:16:48.913>
    creator = 'remi.lapeyre'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 36350
    keywords = ['patch']
    message_count = 3.0
    messages = ['338238', '360718', '360868']
    nosy_count = 3.0
    nosy_names = ['rhettinger', 'yselivanov', 'remi.lapeyre']
    pr_nums = ['12412']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue36350'
    versions = ['Python 3.9']

    @remilapeyre
    Copy link
    Mannequin Author

    remilapeyre mannequin commented Mar 18, 2019

    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)])

    @remilapeyre remilapeyre mannequin added 3.8 only security fixes stdlib Python modules in the Lib dir type-feature A feature request or enhancement labels Mar 18, 2019
    @rhettinger
    Copy link
    Contributor

    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.

    @methane
    Copy link
    Member

    methane commented Jan 28, 2020

    New changeset 2cca8ef by Inada Naoki (Rémi Lapeyre) in branch 'master':
    bpo-36350: inspect: Replace OrderedDict with dict. (GH-12412)
    2cca8ef

    @methane methane added 3.9 only security fixes and removed 3.8 only security fixes labels Jan 28, 2020
    @methane methane closed this as completed Jan 28, 2020
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.9 only security fixes stdlib Python modules in the Lib dir type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants