-
Notifications
You must be signed in to change notification settings - Fork 259
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for descriptors as model fields #1592
Conversation
# Conflicts: # src/validators/model.rs
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1592 +/- ##
==========================================
- Coverage 90.21% 89.51% -0.71%
==========================================
Files 106 112 +6
Lines 16339 17916 +1577
Branches 36 40 +4
==========================================
+ Hits 14740 16037 +1297
- Misses 1592 1859 +267
- Partials 7 20 +13
... and 61 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
CodSpeed Performance ReportMerging #1592 will not alter performanceComparing Summary
|
Please review |
This is my first submission attempt for pydantic-core. I've tried to follow all the guidelines but please forgive (and educate!) me if I missed anything |
Change Summary
Add support for descriptors as model fields. Check newly-introduced
__pydantic_descriptor_fields__
to determine whether to get/set fields via__dict__
or__getattribute__
/__setattr__
get_model_dict()
andset_model_dict()
, which get/set descriptor fields which handling__dict__
get_inner_value()
to supplementattrs
with descriptor values, if presentNote that this change can be released standalone, but will not on its own enable all the functionality to fix the pydantic/pydantic issue. That also requires this pydantic/pydantic change.
Related issue number
pydantic/pydantic Issue
pydantic/pydantic Pull Request
Checklist
pydantic-core
(except for expected changes)Selected Reviewer: @sydney-runkle