3 ms·
dataclass has __post_init__ as a mechanism for doing what you'd normally do in __init__ besides what dataclasses do in the generated __init__, because the gener
by dragonwriter 6y ago
dataclass has __post_init__ as a mechanism for doing what you'd normally do in __init__ besides what dataclasses do in the generated __init__, because the generated __init__ means you can't do it in __init__, and otherwise you'd have to override (and replicate the function of) the generated __init__.
It is not equivalent to PrePostMetaInit.