You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
).
On the other hand, when getting an attribute, it is running the __getattribute__ implementation, which is basically looking for the object dict, then the class hierarchy then the __getattr__ implementation afterwards only.
If Extra.allow is set, the setattr is saving it to a place which is not accessed in the same order by default. See the example code. It prints the "1,1,patched" instead of "1,patched,patched".
Hi, this is vendito-david on my non-corporate user. I made an issue instead of PR because i am not that familiar with the new pydantic v2 and your conventions yet.
Initial Checks
Description
When setting an attribute, it is saving it with __setattr__ into __pydantic_extra__ (
pydantic/pydantic/main.py
Line 802 in b403666
On the other hand, when getting an attribute, it is running the __getattribute__ implementation, which is basically looking for the object dict, then the class hierarchy then the __getattr__ implementation afterwards only.
If Extra.allow is set, the setattr is saving it to a place which is not accessed in the same order by default. See the example code. It prints the "1,1,patched" instead of "1,patched,patched".
Example Code
Output:
Python, Pydantic & OS Version
The text was updated successfully, but these errors were encountered: