Classy Data with Dataclasses | The When of Python Blog
Passing data around can easily become confusing. Dataclasses are a fantastic way of structuring and documenting our data and we should be using them a lot more. They are the only standard keyword-based data structure which can serve both our immutable and our mutable data needs. Maybe we should stop teaching collections.namedtuple and typing.NamedTuple and focus on making dataclasses.dataclasses as idiomatic, familiar, and readable as possible. It would be good to have One Obvious Way of creating keyword data structures.
Oh this is nice! Making dataclass inheritance safe even when using default arguments by having the option of enforcing keywords only (kw_only) in 3.10: Python dataclass inheritance, finally !
Classy Data with Dataclasses | The When of Python Blog
Passing data around can easily become confusing. Dataclasses are a fantastic way of structuring and documenting our data and we should be using them a lot more. They are the only standard keyword-based data structure which can serve both our immutable and our mutable data needs. Maybe we should stop teaching collections.namedtuple and typing.NamedTuple and focus on making dataclasses.dataclasses as idiomatic, familiar, and readable as possible. It would be good to have One Obvious Way of creating keyword data structures.
https://when-of-python.github.io/blog/classy-data-with-dataclasses.html