-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
bpo-37163: Make the obj argument of dataclasses.replace() a positional-only. #14390
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bpo-37163: Make the obj argument of dataclasses.replace() a positional-only. #14390
Conversation
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.
LGTM.
@@ -356,7 +356,7 @@ Module-level decorators, classes, and functions | |||
def add_one(self): | |||
return self.x + 1 | |||
|
|||
.. function:: replace(instance, **changes) | |||
.. function:: replace(instance, /, **changes) |
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.
Maybe add a versionchanged 3.9 markup to document this subtle change?
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.
It was not added in other 35 cases. If it is needed it should be added in all cases.
I am also fine with not documenting the change. That's why I approved your PR 😉 |
https://bugs.python.org/issue37163