GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||
GeezerVison is showing github.com — bpo-33805: Improve error message of dataclasses.replace() by corona10 · Pull Request #7580 · python/cpython Conversation
|
|
@ericvsmith PTAL |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. See comments.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I don't think it's worth adding this mapping and the new __str__ just for this one error message.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
For consistency with the rest of the code, please change '{f.name}' to {f.name!r}. Also, just hard-code InitVar in the message, since this message is only applicable with InitVars.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
The else is not needed.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Please add a test that shows that an InitVar does work with replace(), and check that its value is used (probably via a __post_init__ method). Maybe something like:
def __post_init__(self, y):
self.x *= y
or similar.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer "Improve error message of dataclasses.replace() when an InitVar is not specified".
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
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 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@ericvsmith |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks for making the requested changes! @ericvsmith: please review the changes made to this pull request. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks! Looks good. I'm going to wait a few days before I merge this, because at this late date I don't want to put this in to 3.7.0, I'll wait for 3.7.1. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks @corona10 for the PR, and @ericvsmith for merging it 🌮🎉.. I'm working now to backport this PR to: 3.7. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
GH-7876 is a backport of this pull request to the 3.7 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
) (cherry picked from commit 3d70f7a) Co-authored-by: Dong-hee Na <[email protected]>
(cherry picked from commit 3d70f7a) Co-authored-by: Dong-hee Na <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.