- https://www.youtube.com/watch?v=vBH6GRJ1REM intro
- https://www.youtube.com/watch?v=vCLetdhswMg alternatives to dataclasses
- Class variables with dataclasses https://stackoverflow.com/questions/57966177/class-attribute-and-metaclass-in-dataclasses
Why use them?
Dataclass = a feature that defines classes that contain and encapsulate data.
- Less boilerplate code
- More readability and better code maintainability
- Same lots of coding time (you don’t need to write repr, eq, hash - and make immutable with @property, ne, lt, le, gt, ge)
- Even if you finished all your code, in the future you could change your class, and you need to rewrite the class, but instead we can use dataclasses.