▲ | itamarst a day ago | |||||||
You can't add extra attributes that weren't part of the original dataclass definition:
Most of the time this is not a thing you actually need to do. | ||||||||
▲ | masklinn a day ago | parent | next [-] | |||||||
Also some of the introspection stops working e.g. vars(). If you're using dataclasses it's less of an issue because dataclasses.asdict. | ||||||||
▲ | monomial a day ago | parent | prev [-] | |||||||
I rarely need to dynamically add attributes myself on dataclasses like this but unfortunately this also means things like `@cached_property` won't work because it can't internally cache the method result anywhere. | ||||||||
|