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.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
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
The text was updated successfully, but these errors were encountered: