Relative Content

Tag Archive for pythoninheritancepython-dataclasses

Dataclass inheriting using kw_only for all variables

I am practicing on using the super function and dataclass inheritance in general. I have enabled the kw_only attribute for cases when the parent class has default values. I completely understand that super doesn’t need to be used in a dataclass if you’re just passing variables and I can avoid using super here. My goal is to understand the super feature better through this example. I can’t understand the error message I’m getting though.

Inheriting from Python dataclass

I started using dataclasses recently and having some issues understanding how the inheritance works. I can’t understand the problem with too many variables being passed on. Am I using the super() method correctly here?