▲ | m_ke a day ago | |||||||
Or just dump pydantic and use msgspec instead: https://jcristharif.com/msgspec/ | ||||||||
▲ | mbb70 a day ago | parent | next [-] | |||||||
A great feature of pydantic are the validation hooks that let you intercept serialization/deserialization of specific fields and augment behavior. For example if you are querying a DB that returns a column as a JSON string, trivial with Pydantic to json parse the column are part of deser with an annotation. Pydantic is definitely slower and not a 'zero cost abstraction', but you do get a lot for it. | ||||||||
| ||||||||
▲ | itamarst a day ago | parent | prev | next [-] | |||||||
msgspec is much more memory efficient out of the box, yes. Also quite fast. | ||||||||
▲ | aitchnyu 15 hours ago | parent | prev | next [-] | |||||||
Can it do incremental parsing? Cant tell from a brief look. | ||||||||
| ||||||||
▲ | 21 hours ago | parent | prev [-] | |||||||
[deleted] |