5 ms·
I used to be a strong proponent of this, but I tend to use dataclasses more and more with time. Still use a lot of dicts, lists, and sets, but mostly as collect
by sametmax 3y ago
I used to be a strong proponent of this, but I tend to use dataclasses more and more with time. Still use a lot of dicts, lists, and sets, but mostly as collections, rarely to hold one single element data.
It came naturally, not out of some design, but I guess having better and better typing support everywhere makes it more and more convenient.
- david-j-vujic 3y agoSounds like a good balance between the approaches! I usually would prefer having everything behind the endpoint (such as Pydantic schemas & FastAPI) as simple dicts and lists.