Open
Description
This error is seen whenever a subclass defines a mandatory attribute when a base class defines attribute(s) with default values.
see test_kwonly_fix.py
and test_sbase.py
The docs say to apply kw_only=True to the subclass attribute, and this allows the spec to be defined but still causes and error when trying to instantiate the object: if effectively turns the kw_only attribute into a required attribute as an error happens if no value is set, therefore we need to use default=None to supply a dummy default value anyway.
Therefore the best solution seems to be to ignore kw_only and just set everything to have default=None
Metadata
Metadata
Assignees
Labels
No labels