5 ms·
> dataclasses is not very extensible or flexible. It's fine for starting with, but it's not at all a replacement for store_attr etc. > At fast.ai we used datac
by nemetroid 6y ago
> dataclasses is not very extensible or flexible. It's fine for starting with, but it's not at all a replacement for store_attr etc.
> At fast.ai we used dataclasses extensively for a couple of years, but it just kept biting us.
What were the issues you had?
- Recursing 6y agohttps://www.attrs.org/en/stable/why.html#data-classes https://www.attrs.org/en/stable/why.html#data-classes The most used python library for these things is attrs, I think it mostly provides support for slotted classes (more memory efficient), "converters" (normalization), validation and serialization
- jph00 6y agoThe key issue is that it requires inheritance, but doesn't actually support subclassing very well. Also it relies on python's type system, which is rather limited. It's a very large module for what it does, and understanding all the details of how it works in practice is a big challenge.