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
New in version 3.10.
kw_only: If true (the default value is False), then all fields will be marked as keyword-only. If a field is marked as keyword-only, then the only effect is that the init() parameter generated from a keyword-only field must be specified with a keyword when init() is called. There is no effect on any other aspect of dataclasses. See the parameter glossary entry for details. Also see the KW_ONLY section.
Source: https://docs.python.org/3/library/dataclasses.html
It solves the limitation that a base class can't hold default values.
Example:
https://stackoverflow.com/questions/51575931/class-inheritance-in-python-3-7-dataclasses
The text was updated successfully, but these errors were encountered: