[issue43965] dataclasses.replace breaks when __init__ is overrriden in subclass

Eric V. Smith report at bugs.python.org
Wed Apr 28 05:43:54 EDT 2021


Eric V. Smith <eric at trueblade.com> added the comment:

I'm open to suggestions on how this could be fixed, but I don't see how it's possible. I guess the best thing to do would be to fail if __init__() isn't the one that was generated by @dataclass. But that might be too pessimistic: the user could have provided a __init__() that does work with replace(), and such a change would start breaking that code.

----------
assignee:  -> eric.smith
nosy: +eric.smith
versions: +Python 3.10 -Python 3.7, Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43965>
_______________________________________


More information about the Python-bugs-list mailing list