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-102103: add `module` argument to `dataclasses.make_dataclass` by sobolevn · Pull Request #102104 · python/cpython

Conversation

@sobolevn

@sobolevn sobolevn commented Feb 21, 2023 •
edited by bedevere-bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

Now, dataclasses created by this function are also pickleable (as a side effect of fixing __module__ attribute).

  • Issue: Classes and instances produced by dataclasses.make_dataclass are not pickleable #102103

Sorry, something went wrong.

Uh oh!

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

Fatal1ty reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@sobolevn
pythongh-102103: add module argument to dataclasses.make_dataclass
58743b1
@sobolevn
sobolevn requested a review from ericvsmith as a code owner February 21, 2023 08:57
@bedevere-bot bedevere-bot added the awaiting review label Feb 21, 2023
@bedevere-bot bedevere-bot mentioned this pull request Feb 21, 2023
Classes and instances produced by dataclasses.make_dataclass are not pickleable #102103
Closed
@sobolevn
Fix typo
3cc2c75
carljm
carljm reviewed Feb 22, 2023
View reviewed changes

@carljm carljm left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a real issue, and solving it in the same way as namedtuple seems reasonable (though it's too bad to add more stack-walking.)

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread Lib/test/test_dataclasses.py Resolved

Uh oh!

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

Comment thread Lib/test/test_dataclasses.py Resolved

Uh oh!

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

@sobolevn @carljm
Update Lib/test/test_dataclasses.py
7a77839
Co-authored-by: Carl Meyer <[email protected]>
sobolevn
sobolevn commented Feb 22, 2023
View reviewed changes
Comment thread Lib/test/test_dataclasses.py Resolved

Uh oh!

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

@sobolevn
Update Lib/test/test_dataclasses.py
2833e1c
@sobolevn

sobolevn commented Mar 8, 2023

Copy link
Copy Markdown
Member Author

@ericvsmith friendly ping :)

All reactions

Sorry, something went wrong.

Uh oh!

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

carljm
carljm approved these changes Mar 8, 2023
View reviewed changes
@bedevere-bot bedevere-bot added awaiting merge and removed awaiting review labels Mar 8, 2023
@carljm
carljm merged commit b48be8f into python:main Mar 11, 2023
@bedevere-bot bedevere-bot removed the awaiting merge label Mar 11, 2023
@sobolevn

sobolevn commented Mar 11, 2023

Copy link
Copy Markdown
Member Author

Thanks!

All reactions

Sorry, something went wrong.

Uh oh!

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

iritkatriel pushed a commit to iritkatriel/cpython that referenced this pull request Mar 12, 2023
@sobolevn @iritkatriel
pythongh-102103: add module argument to dataclasses.make_dataclass (
cdf9e3a
python#102104)
@sobolevn sobolevn mentioned this pull request Mar 20, 2023
inspect.getsource() on sourceless dataclass raises undocumented exception #98239
Closed
@remilapeyre remilapeyre mentioned this pull request Apr 11, 2024
Add module/qualname arguments to make_dataclass for picklability #79413
Closed
@brass75 brass75 mentioned this pull request May 18, 2026
gh-79413: Add qualname parameter to dataclass.make_dataclass. #150026
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@carljm carljm carljm approved these changes
@ericvsmith ericvsmith Awaiting requested review from ericvsmith ericvsmith is a code owner

Uh oh!

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

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

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

3 participants

@sobolevn @carljm @bedevere-bot
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.