Comments (3)
Hi and thanks for the invitation!
IMO keeping it private for now is for the best: less pressure, not too much feedback, ...
First and most importantly I feel like it's a wonderful idea and already a great start! Splitting the code base of pydantic between pure validation and serializers, json schema, settings... is needed and I'm glad to see rust used for pydantic-core like so many great high performance libraries (orjson, tokenizers...)
I was having a look and I really love this idea!
I see you're already implementing it 🚀
I started working a while ago on a POC of tydantic (it was actually the name I took too 😆) but it was not based on a rust + json core, which feels way better.
I will take some time to review the code you already wrote and maybe write some kind of UML diagram to have a better vision of the whole implementation. Maybe I missed something but I was surprised to see nothing on strict checks. IMO it could be great to have something a bit like this to allow also strictness and custom coercion! (with pydantic declaring its own coercers)
from pydantic-core.
Thanks @PrettyWood, great to hear you think it's a good idea.
currently the implementation of #10 won't allow removal of python since only the input types are generalised, not the output types, but hopefully that can be change in future.
The problem I have right now is that parsing JSON inside pydantic-core is currently a lot slower than parsing json with ujson.loads
or even json.loads
then passing the output to pydantic-core
- I'm looking into why that is now.
from pydantic-core.
Forgot to say, strict types should be easy to implement. I've already altered some of the allowed types to make checks stricter should should improve usage, e.g.:
- floats are only allowed as inputs to int fields if
f % 1 == 0
- lists of pairs won't be allowed as input to dict types
from pydantic-core.
Related Issues (20)
- Lower MSRV to 1.75
- `include` and `exclude` are not passed to field serializer contexts in function serializer HOT 1
- fail-fast list schema configuration
- Make better union validation decisions based on `extra` behavior HOT 6
- Specify value in UserWarning "serialized value may not be as expected" HOT 2
- Proposal for mapping Python types to CombinedValidator HOT 13
- Numerically constrainted fields don't generate proper error on non-Number fields HOT 1
- Making `ObType` a separate crate
- ValidationError missing reference to model being validated
- Fail-fast feature HOT 2
- [pydantic #9683] @field_serializer("*") is not compatible with @computed_field when expecting FieldSerializationInfo
- SIGSEGV Linux arm64, python3.13-nogil HOT 2
- Failed to install pydantic-core from sources HOT 12
- Creating Pydantic objects in Rust and passing to the interpreter. HOT 4
- Build directory (as a string) injected into _pydantic-core.*.so (which will cause non-reproducible builds) HOT 5
- Pydantic-core 2.10.1 installation is failing in Python 3.12.4 and Rustc 1.79.0 HOT 1
- Inconsistent Behavior in Pattern Matching String HOT 1
- could not compile `thiserror` (lib) due to 1 previous error HOT 17
- Improvement in generic schema generation HOT 1
- Field pattern regex validation fails inconsistent to constr HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pydantic-core.