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.
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
assignee='https://github.com/ericvsmith'closed_at=<Date2018-03-21.09:23:12.424>created_at=<Date2018-02-21.16:21:45.999>labels= ['3.7', '3.8', 'type-bug', 'library', 'release-blocker']
title='Error when subclassing a dataclass with a field that uses a defaultfactory'updated_at=<Date2018-03-21.09:23:12.424>user='https://bugs.python.org/JohnDidion'
Traceback (most recent call last):
File "<stdin>", line 1, in <module>TypeError: __init__() missing 1 required positional argument: 'x'
I understand that this is desired behavior when the subclass contains non-default attributes. But subclasses that define no additional attributes should work just the same as those that define only additional default attributes.
A similar issue was raised and dismissed when dataclasses was in development on GitHub: ericvsmith/dataclasses#112, but that only concerned the case of subclasses defining non-default attributes.