Author Кирилл Чуркин
Recipients Кирилл Чуркин
Date 2019-02-22.12:27:13
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1550838433.8.0.658564691536.issue36077@roundup.psfhosted.org>
In-reply-to
Content
I found a problem when use inherit dataclasses.
When I define parent dataclass with field(s) with default (or default_factory) properties, and inherit child dataclass from parent, i define non-default field in it and got `TypeError('non-default argument {f.name!r} follows default argument')` in dataclasses.py(466)._init_fn. It happens because dataclass constructor defines all parent class fields as arguments in __init__ class and then all child class fields.
Maybe it need to define all non-default fields in init before all default.
History
Date User Action Args
2019-02-22 12:27:13Кирилл Чуркинsetrecipients: + Кирилл Чуркин
2019-02-22 12:27:13Кирилл Чуркинsetmessageid: <1550838433.8.0.658564691536.issue36077@roundup.psfhosted.org>
2019-02-22 12:27:13Кирилл Чуркинlinkissue36077 messages
2019-02-22 12:27:13Кирилл Чуркинcreate