-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Keep values of private attributes set within model_post_init
in subclasses
#7775
Keep values of private attributes set within model_post_init
in subclasses
#7775
Conversation
please review |
Thanks so much for your contribution! Could you take a look at this comment when you have a chance? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good otherwise 👍 just a small change request
@dmontagu did you have a test change you wanted to add? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks so much for this contribution 🌟.
Note to myself, when I work on the #7656 task, I want to add a more robust test for this behavior. |
Change Summary
Check for an existing
__pydantic_private__
dict ininit_private_attributes
and account for values within, rather than always replacing with a new dict.Related issue number
Fixes #7091
Checklist
Selected Reviewer: @sydney-runkle