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 — gh-79413: Add `qualname` parameter to `dataclass.make_dataclass`. by brass75 · Pull Request #150026 · python/cpython

Conversation

@brass75

@brass75 brass75 commented May 18, 2026

Copy link
Copy Markdown
Contributor

Resolves #79413

Added qualname parameter to dataclasses.make_dataclass in order to allow user to set __qualname__ for the generated class.

The pickle issue mentioned in GH-79413 was resolved by #102104 which added the module argument however that PR did not include allowing the user to set __qualname__ for the generated class. This PR resolves that remaining part of this issue.

There should be no backwards compatibility issues - current code that calls make_dataclass without the qualname parameter will continue to create classes that use the cls_name parameter as the __qualname__ with no changes.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Erutis reacted with rocket emoji
All reactions
  • 🚀 1 reaction
@brass75
Add qualname parameter to dataclass.make_dataclass.
0324106
Added `qualname` parameter to `dataclasses.make_dataclass` in order to allow user to set `__qualname__` for the generated class.
@brass75
brass75 requested a review from ericvsmith as a code owner May 18, 2026 20:57
@python-cla-bot

python-cla-bot Bot commented May 18, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.

CLA signed

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot mentioned this pull request May 18, 2026
Add module/qualname arguments to make_dataclass for picklability #79413
Closed
@bedevere-app bedevere-app Bot added the awaiting review label May 18, 2026
@read-the-docs-community

read-the-docs-community Bot commented May 18, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #32747959 | 📁 Comparing 6e529ab against main (5775aa8)

  🔍 Preview build  

6 files changed · ± 6 modified

± Modified

  • library/dataclasses.html
  • library/inspect.html
  • library/os.html
  • library/pathlib.html
  • whatsnew/3.15.html
  • whatsnew/changelog.html
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

nedbat
nedbat reviewed May 18, 2026
View reviewed changes
Comment thread Doc/library/dataclasses.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

@JelleZijlstra JelleZijlstra changed the title gh-79413 Add qualname parameter to dataclass.make_dataclass. gh-79413: Add qualname parameter to dataclass.make_dataclass. May 18, 2026
StanFromIreland
StanFromIreland reviewed May 18, 2026
View reviewed changes
Comment thread Doc/library/dataclasses.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

@brass75
PR feedback on documentation.
80cc3e8
- Added `versionadded:: next` for `qualname` parameter
- Fixed formatting.
@cmaloney cmaloney added the sprint label May 18, 2026
@github-project-automation github-project-automation Bot added this to Sprint May 18, 2026
@github-project-automation github-project-automation Bot moved this to Todo in Sprint May 18, 2026
cmaloney
cmaloney approved these changes May 18, 2026
View reviewed changes
Comment thread Misc/NEWS.d/next/Library/2026-05-18-13-43-06.gh-issue-79413.OpTXbV.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

@github-project-automation github-project-automation Bot moved this from Todo to In Progress in Sprint May 18, 2026
@bedevere-app bedevere-app Bot added awaiting core review and removed awaiting review labels May 18, 2026
@brass75
PR feedback on documentation.
e2db26a
- Fix section on `qualname` parameter to link to `type.__qualname__`.
JelleZijlstra
JelleZijlstra approved these changes May 18, 2026
View reviewed changes
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting core review labels May 18, 2026
ericvsmith
ericvsmith requested changes May 18, 2026
View reviewed changes
Comment thread Lib/test/test_dataclasses/__init__.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot added awaiting changes and removed awaiting merge labels May 18, 2026
@bedevere-app

bedevere-app Bot commented May 18, 2026

Copy link
Copy Markdown

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@brass75
PR feedback on tests.
6e529ab
- Add test case for `module.Class` for `qualname`.
- Add test case for `qualname` not set.
ericvsmith
ericvsmith approved these changes May 18, 2026
View reviewed changes
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting changes labels May 18, 2026
@ericvsmith
ericvsmith merged commit 398d7e1 into python:main May 18, 2026
55 of 56 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the awaiting merge label May 18, 2026
@github-project-automation github-project-automation Bot moved this from In Progress to Done in Sprint May 18, 2026
@brass75
brass75 deleted the issue-79413 branch May 19, 2026 00:04
@encukou encukou mentioned this pull request May 19, 2026
gh-79413: Add module and qualname arguments to dataclasses.make_dataclass() #11371
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@nedbat nedbat nedbat left review comments
@cmaloney cmaloney cmaloney approved these changes
@StanFromIreland StanFromIreland StanFromIreland left review comments
@ericvsmith ericvsmith ericvsmith approved these changes
@JelleZijlstra JelleZijlstra JelleZijlstra approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

sprint

Projects

Sprint
Archived in project

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Add module/qualname arguments to make_dataclass for picklability

Uh oh!

There was an error while loading. Please reload this page.

6 participants

@brass75 @nedbat @ericvsmith @cmaloney @JelleZijlstra @StanFromIreland
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — 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.