@dataclass class C: a: float b: float c: float = field(init=False) def __post_init__(self): self.c = self.a + self.b