You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Rename dataclass's __replace__ argument from "obj" to "self"? #114198
The first argument of the new __replace__ method on dataclasses is conspicuously named obj rather than self. While that's not a bug, it would be kinder on introspection tools to use self, since it is otherwise a regular instance method.
Activity
serhiy-storchaka commentedon Jan 17, 2024
It is a trivial change. You just need to rename a parameter of function
_replace()indataclassesmodule.ericvsmith commentedon Jan 18, 2024
@pschanely : Do you want to make a PR?
pschanely commentedon Jan 18, 2024
Oh. Well, I haven't contributed to cpython before, but I'm willing to give it a try.
ericvsmith commentedon Jan 18, 2024
@pschanely : Reach out if you need any help!
gh-114198: Rename dataclass __replace__ argument to 'self' (gh-114251)
ericvsmith commentedon Jan 18, 2024
Thanks, @pschanely !
pythongh-114198: Rename dataclass __replace__ argument to 'self' (pyt…
pythongh-114198: Rename dataclass __replace__ argument to 'self' (pyt…
pythongh-114198: Rename dataclass __replace__ argument to 'self' (pyt…