4 ms·
Please please take a look at V2, both the code and the documentation (although I admit, the documentation for V2 isn't finished). I (the developer of Pydantic)
by scolvin 3y ago
Please please take a look at V2, both the code and the documentation (although I admit, the documentation for V2 isn't finished).
I (the developer of Pydantic) had many of the same frustrations with Pydantic V2 which is why I've spent so long rewriting it to try and fix these concerns.
In particular:
* we now have API documentation [1]
* we have first class support for validating `TypedDict` which gives you a typing-valid dict representation of your data straight out of validation
* we now have strict mode
* we're working hard to define an exact spec for what validates to what [2]
* we have a strict separation between public/private - everything private is in a `pydantic._internal` module, and we have unit tests that everything which can be publicly imported is explicitly public
* we now use `Annotated[]` for defining custom validations/constraints, together with annotated-types [3]
* the protocol for customising validation and serialization has been significantly improved [4]
I'd really love to hear your feedback on V2 and what more we can do to improve it - your feedback seem unusual reasonable for HN ;-) - please email samuel@pydantic.dev or create an issue/discussion if you have any thoughts.
1: https://docs.pydantic.dev/latest/api/main/ https://docs.pydantic.dev/latest/api/main/
2: https://docs.pydantic.dev/latest/usage/conversion_table/ https://docs.pydantic.dev/latest/usage/conversion_table/
3: https://github.com/annotated-types/annotated-types https://github.com/annotated-types/annotated-types
4: https://docs.pydantic.dev/latest/usage/types/custom/ https://docs.pydantic.dev/latest/usage/types/custom/