News for hackers. Stuff that matters.
Re:Ask HN: Pydantic has too much deprecation. Why is it popu... by botanicalfriend on Saturday January 06, 2024 @01:32PM (#38893871)
From my perspective a large factor contributing to its popularity is because of FastAPIs native integration. V2 has broken so much behavior, and the library is generally fragile and slow. Credit where it is due, it is a great library that has done a lot to bring python types to more projects, but there are better solutions out there now.

I’d strongly recommend looking into msgspec. It is a much faster alternative and is largely “correct” in its implementation. It uses all of the python native type annotations without many hacks. Really it is much much faster and can actually be used for performance sensitive python workloads that need strong typing.

Re:Ask HN: Pydantic has too much deprecation. Why is it popu... by scolvin on Tuesday January 09, 2024 @03:10PM (#38931354)
That's simply not true. It's much faster than most similar libraries, 16x faster than DRF, 30x faster than Cerberus.

Msgspec is impressive in some ways, but there are good reasons to use Pydantic instead - for a start msgspec is written in a non-memory safe language by (mostly) one person, and is less widely tested than Pydantic.