|
|
|
|
|
by breatheoften
330 days ago
|
|
classes are a bad way to model data imo I wish python had a clean way to define types without defining classes. Think a _good_ mechanism to define the shape of data contained within primitives/builtins containers without classes -- ala json/typescript (ideally extended with ndarray and a sane way to represent time) Python classes wrapped around the actual "data" are sometimes necessary but generally always bad boilerplate in my experience. |
|
dataclasses are pretty much that. They use the class mechanism but they're culturally accepted now as a clean way to build the equivalent of structs.