Is it possible to declare a default value for an attribute in a subclass in python?
Eg something like this:
@dataclass_json
@dataclass
class BaseClass:
b: str
a: str
@dataclass_json
@dataclass
class SubClass(BaseClass):
c: str
d: str
a: str = "my value"
I tried this and I'm getting the following error:
TypeError: non-default argument 'c' follows default argument
I also tried putting a
before c
and d
in the subclass without success (same error).
Is there a way to achieve this?