oof here's a cursed question:
how does one make a #python dataclass with a subclass that changes *only* the default values of its fields, without adding new ones? is that doable?
3
oof here's a cursed question:
how does one make a #python dataclass with a subclass that changes *only* the default values of its fields, without adding new ones? is that doable?
@glyph yes. I remember doing it without annoted types as well. plain old Python classes and inheritance
oh you can just literally annotate it again, and it works, apparently
much easier than I thought
from dataclasses import dataclass
@dataclass
class A:
value: int = 0
@dataclass
class B(A):
value: int = 1
print(A())
print(B())