Python Dataclasses: Using __post_init__ for Validation and Computed Fields
Use @dataclass with __post_init__ to validate inputs and compute derived fields after initialization. Learn how to enforce invariants, handle mutable defaults, work with frozen dataclasses, and avoid common pitfalls like shared mutable state and inheritance issues.