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

dataclasses: generated method's using the wrong qualname #85913

Closed
isidentical opened this issue Sep 8, 2020 · 5 comments
Closed

dataclasses: generated method's using the wrong qualname #85913

isidentical opened this issue Sep 8, 2020 · 5 comments
Assignees
Labels
3.10 only security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@isidentical
Copy link
Sponsor Member

BPO 41747
Nosy @ericvsmith, @isidentical
PRs
  • bpo-41747: Ensure all dataclass methods uses their parents' qualname #22155
  • 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 = 'https://github.com/ericvsmith'
    closed_at = <Date 2020-10-21.13:50:18.058>
    created_at = <Date 2020-09-08.20:38:57.596>
    labels = ['type-bug', 'library', '3.10']
    title = "dataclasses: generated method's using the wrong qualname"
    updated_at = <Date 2020-10-21.13:50:18.057>
    user = 'https://github.com/isidentical'

    bugs.python.org fields:

    activity = <Date 2020-10-21.13:50:18.057>
    actor = 'eric.smith'
    assignee = 'eric.smith'
    closed = True
    closed_date = <Date 2020-10-21.13:50:18.058>
    closer = 'eric.smith'
    components = ['Library (Lib)']
    creation = <Date 2020-09-08.20:38:57.596>
    creator = 'BTaskaya'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 41747
    keywords = ['patch']
    message_count = 3.0
    messages = ['376594', '379208', '379209']
    nosy_count = 2.0
    nosy_names = ['eric.smith', 'BTaskaya']
    pr_nums = ['22155']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue41747'
    versions = ['Python 3.10']

    @isidentical
    Copy link
    Sponsor Member Author

    $ cat t.py
    from dataclasses import dataclass
    @dataclass
    class Foo:
        bar: int
    
    Foo()
    $ python t.py
    Traceback (most recent call last):
      File "/home/isidentical/cpython/cpython/t.py", line 7, in <module>
        Foo()
    TypeError: __create_fn__.<locals>.__init__() missing 1 required positional argument: 'bar'

    @isidentical isidentical added 3.10 only security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Sep 8, 2020
    @ericvsmith
    Copy link
    Member

    New changeset c7437e2 by Batuhan Taskaya in branch 'master':
    bpo-41747: Ensure all dataclass methods uses their parents' qualname (GH-22155)
    c7437e2

    @ericvsmith
    Copy link
    Member

    Thanks for the PR!

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    @USSX-Hares
    Copy link

    Will this be ported to other versions of Python? I have this issue reproduced on Python 3.7.13 and Python 3.9.12.

    @ericvsmith
    Copy link
    Member

    No, it won't be backported. Both 3.7 and 3.9 are only accepting security related patches.

    You could fix it in a custom distribution, but that's about your only option.

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.10 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

    3 participants