[issue43835] Dataclasses don't call base class __init__

Eric V. Smith report at bugs.python.org
Tue Apr 13 20:26:11 EDT 2021


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

> The dataclass doesn't need to know what arguments the parent __init__ accepts. It should consume the arguments it needs to initialize its instance attributes, and forward the rest to the parent __init__.

The generated __init__() uses every parameter to initialize instance attributes (if we ignore InitVar). So are you saying it should call the base class with no parameters?

----------

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


More information about the Python-bugs-list mailing list