3 ms·
Dataclasses and Enums have, since their introduction, taken over as my foundation of Python data structures. They've obsoleted NamedTuple, namedtuple, and tradi
by the__alchemist 5y ago
Dataclasses and Enums have, since their introduction, taken over as my foundation of Python data structures. They've obsoleted NamedTuple, namedtuple, and traditional classes in my code.
They're a clean way of defining how difference functions, methods etc should interact with each other.
- synergy20 5y agowhat do you mean by 'traditional classes', dataclasses are more for data-only data structure with no methods?
- the__alchemist 5y agoAs in, classes that aren't tagged as `dataclass` or `Enum`. You can have methods with dataclasses.