GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add `module`/`qualname` arguments to make_dataclass for picklability · Issue #79413 · python/cpython

Add module/qualname arguments to make_dataclass for picklability #79413

New issue
Copy link
New issue
Copy link
Closed
#150026
Closed
Add module/qualname arguments to make_dataclass for picklability#79413
#150026
Copy link
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-dataclassestype-featureA feature request or enhancementA feature request or enhancement

Description

anntzer
mannequin
opened on Nov 13, 2018
Issue body actions
BPO 35232
Nosy @ericvsmith, @ilevkivskyi, @csabella, @remilapeyre
PRs
  • gh-79413: Add module and qualname arguments to dataclasses.make_dataclass() #11371
  • gh-79413: Add module and qualname arguments to dataclasses.make_dataclass() #11371
  • 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 = None
    created_at = <Date 2018-11-13.14:30:46.300>
    labels = ['3.7', '3.8', '3.9', '3.10', 'type-feature', 'library']
    title = 'Add `module`/`qualname` arguments to make_dataclass for picklability'
    updated_at = <Date 2020-06-21.00:43:53.291>
    user = 'https://github.com/anntzer'

    bugs.python.org fields:

    activity = <Date 2020-06-21.00:43:53.291>
    actor = 'remi.lapeyre'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Library (Lib)']
    creation = <Date 2018-11-13.14:30:46.300>
    creator = 'Antony.Lee'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 35232
    keywords = ['patch', 'patch']
    message_count = 3.0
    messages = ['329847', '332761', '342283']
    nosy_count = 4.0
    nosy_names = ['eric.smith', 'levkivskyi', 'cheryl.sabella', 'remi.lapeyre']
    pr_nums = ['11371', '11371']
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue35232'
    versions = ['Python 3.7', 'Python 3.8', 'Python 3.9', 'Python 3.10']

    Linked PRs

    • gh-79413: Add qualname parameter to dataclass.make_dataclass. #150026

    Activity

    1. anntzer commented on Nov 13, 2018

      @anntzer
      anntzermannequin
      on Nov 13, 2018
      MannequinAuthor
      More actions

      Currently, dataclasses created by make_dataclass are not picklable, because their module is set to "types". It seems that this would be easily fixed by letting make_dataclass gain a module and a qualname kwarg, similarly to the Enum functional form (https://docs.python.org/3/library/enum.html#functional-api).

    2. anntzer
      added
      3.7 (EOL)end of lifeend of life
      stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory
      on Nov 13, 2018
    3. remilapeyre commented on Dec 30, 2018

      @remilapeyre
      remilapeyremannequin
      on Dec 30, 2018
      Mannequin
      More actions

      Hi @Anthony.Lee, the __module__ is wrong indeed. The new changeset in #11371 should implement what you need.

      If you don't specify the new module and qualname parameters, make_dataclass() will try to determine the correct module so you should not need to change your code.

    4. csabella
      added
      3.8 (EOL)end of lifeend of life
      type-featureA feature request or enhancementA feature request or enhancement
      and removed
      3.7 (EOL)end of lifeend of life
      on Apr 11, 2019
    5. csabella commented on May 13, 2019

      @csabella
      csabella
      on May 13, 2019
      Contributor
      More actions

      @eric.smith Can you take a look at this when you get a chance? Thanks!

    6. remilapeyre
      added
      3.10 (EOL)end of lifeend of life
      3.7 (EOL)end of lifeend of life
      3.8 (EOL)end of lifeend of life
      3.9 (EOL)end of lifeend of life
      and removed
      3.8 (EOL)end of lifeend of life
      on Jun 21, 2020
    7. ezio-melotti
      transferred this issue fromon Apr 10, 2022
    8. serhiy-storchaka
      added this to Pickle and copy issues 🥒on May 19, 2022
    9. remilapeyre commented on Apr 11, 2024

      @remilapeyre
      remilapeyre
      on Apr 11, 2024
      Contributor
      More actions

      The module part of this has been separately reported at #102103 and fixed in #102104.

      Do we need to take care of qualname still? If so I will update my pull request at #11371, otherwise we can close both this issue and its pull-request.

    10. picnixz
      added
      topic-dataclasses
      and removed
      3.10 (EOL)end of lifeend of life
      3.9 (EOL)end of lifeend of life
      3.8 (EOL)end of lifeend of life
      3.7 (EOL)end of lifeend of life
      on Aug 16, 2024
    11. encukou commented on Sep 2, 2025

      @encukou
      encukou
      on Sep 2, 2025
      Member
      More actions

      Adding qualname would make sense to me, if you're still up to it.

    12. ericvsmith commented on Sep 16, 2025

      @ericvsmith
      ericvsmith
      on Sep 16, 2025
      Member
      More actions

      Agreed. @remilapeyre: Could you take a look at adding qualname? And would this not also apply to namedtuple?

    13. ericvsmith
      closed this as completedin #150026on May 18, 2026
    14. ericvsmith
      added a commit that references this issue on May 18, 2026

      gh-79413: Add `qualname` parameter to `dataclass.make_dataclass`. (GH…

      398d7e1
    15. github-project-automation
      moved this to Done in Pickle and copy issues 🥒on May 18, 2026
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-dataclassestype-featureA feature request or enhancementA feature request or enhancement

      Projects

      • Pickle and copy issues 🥒
        Status
        Done
        Show more project fields

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402520 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.