Guide143.3K views3,311 votes0 replies3,204 following
Python Dataclasses: Eliminating Boilerplate Without Shared-State Bugs
Use @dataclass to generate __init__ and __repr__ automatically, but mutable defaults, frozen instances, and inheritance ordering introduce subtle bugs if you skip the mechanics.