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

ParamSpec args and kwargs are not equal to themselves. #90834

Closed
GBeauregard mannequin opened this issue Feb 7, 2022 · 3 comments
Closed

ParamSpec args and kwargs are not equal to themselves. #90834

GBeauregard mannequin opened this issue Feb 7, 2022 · 3 comments
Labels
3.10 only security fixes 3.11 only security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@GBeauregard
Copy link
Mannequin

GBeauregard mannequin commented Feb 7, 2022

BPO 46676
Nosy @serhiy-storchaka, @JelleZijlstra, @GBeauregard
PRs
  • bpo-46676: Make ParamSpec args and kwargs equal to themselves #31203
  • [3.10] bpo-46676: Make ParamSpec args and kwargs equal to themselves … #31210
  • 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 2022-02-08.08:41:51.139>
    created_at = <Date 2022-02-07.19:16:53.370>
    labels = ['type-bug', 'library', '3.10', '3.11']
    title = 'ParamSpec args and kwargs are not equal to themselves.'
    updated_at = <Date 2022-02-08.08:41:51.138>
    user = 'https://github.com/GBeauregard'

    bugs.python.org fields:

    activity = <Date 2022-02-08.08:41:51.138>
    actor = 'serhiy.storchaka'
    assignee = 'none'
    closed = True
    closed_date = <Date 2022-02-08.08:41:51.139>
    closer = 'serhiy.storchaka'
    components = ['Library (Lib)']
    creation = <Date 2022-02-07.19:16:53.370>
    creator = 'GBeauregard'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 46676
    keywords = ['patch']
    message_count = 3.0
    messages = ['412781', '412816', '412820']
    nosy_count = 3.0
    nosy_names = ['serhiy.storchaka', 'JelleZijlstra', 'GBeauregard']
    pr_nums = ['31203', '31210']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue46676'
    versions = ['Python 3.10', 'Python 3.11']

    @GBeauregard
    Copy link
    Mannequin Author

    GBeauregard mannequin commented Feb 7, 2022

    from typing import ParamSpec
    P = ParamSpec("P")
    print(P.args == P.args)  # False
    print(P.kwargs == P.kwargs)  # False

    ParamSpec args and kwargs are not equal to themselves; this can cause problems for unit tests and type introspection w/ e.g. get_type_hints.

    I will fix this by adding an __eq__ method like other places in typing.py

    @GBeauregard GBeauregard mannequin added 3.10 only security fixes 3.11 only security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Feb 7, 2022
    @serhiy-storchaka
    Copy link
    Member

    New changeset c8b62bb by Gregory Beauregard in branch 'main':
    bpo-46676: Make ParamSpec args and kwargs equal to themselves (GH-31203)
    c8b62bb

    @serhiy-storchaka
    Copy link
    Member

    New changeset cbdcae5 by Gregory Beauregard in branch '3.10':
    [3.10] bpo-46676: Make ParamSpec args and kwargs equal to themselves (GH-31203) (GH-31210)
    cbdcae5

    @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.10 only security fixes 3.11 only security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant