Hacker News new | ask | show | jobs
by JimDabell 359 days ago
I’ve never really gotten along with Pydantic. Something about it just doesn’t feel ergonomic.

If I need something more than dataclasses, I’ll normally go for attrs/cattrs. Dataclasses were originally based on attrs, so it’s not much of a leap.

1 comments

I never understood why basemodel even exists.

When I started to implement typedload, when types were just introduced, I supported NamedTuple, and then as more things were added, also attrs, dataclasses, typed dict…

What would be the point to require migrating the whole codebase to use something different to use your library?

On the other hand, if you wrote your code from scratch to use basemodel you're pretty much stuck with pydantic.