Skip to content

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

Closed

Description

@isidentical
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']

    Activity

    1. isidentical commented on Sep 8, 2020

      @isidentical
      SponsorMemberAuthor
      $ 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'
    2. added
      stdlibStandard Library Python modules in the Lib/ directory
      type-bugAn unexpected behavior, bug, or error
      on Sep 8, 2020
    3. ericvsmith commented on Oct 21, 2020

      @ericvsmith
      Member

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

    4. ericvsmith commented on Oct 21, 2020

      @ericvsmith
      Member

      Thanks for the PR!

    5. transferred this issue fromon Apr 10, 2022
    6. USSX-Hares commented on Jun 23, 2022

      @USSX-Hares

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

    7. ericvsmith commented on Jun 23, 2022

      @ericvsmith
      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

    Metadata

    Metadata

    Assignees

    Labels

    3.10 (EOL)end of lifestdlibStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions