Skip to content

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

Merged

Conversation

serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented Jun 26, 2019

Copy link
Member

@vstinner vstinner left a 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)
Copy link
Member

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?

Copy link
Member Author

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.

@serhiy-storchaka serhiy-storchaka merged commit 2d88e63 into python:master Jun 26, 2019
@serhiy-storchaka serhiy-storchaka deleted the dataclasses-replace-obj branch June 26, 2019 16:07
@vstinner
Copy link
Member

I am also fine with not documenting the change. That's why I approved your PR 😉

lisroach pushed a commit to lisroach/cpython that referenced this pull request Sep 10, 2019
DinoV pushed a commit to DinoV/cpython that referenced this pull request Jan 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-feature A feature request or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants