thewizardplusplus
thewizardplusplus
> You can't just make a _variable_ public, because that allows accidental or > malicious mutation outside of package. This is common practice in Go, recall `io.EOF` or `http.DefaultClient`. The...
@gshpychka, @USSX-Hares, my solution: ```python import dataclasses import dataclasses_json @dataclasses.dataclass # the solution will only work when using inheritance class SomeClass(dataclasses_json.DataClassJsonMixin): field_1: str @property def field_2(self) -> int: return len(self.field_1)...
My temporary workaround: ```python import dataclasses import dataclasses_json @dataclasses.dataclass(frozen=True) # the workaround will only work when using inheritance class DebbieData(dataclasses_json.DataClassJsonMixin): a: str @property def prefixed_a(self) -> str: return f"PREFIX_{self.a}" #...