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
Describe the bug
PyCharm marks private fields as read-only although pydantic docs say that private attributes are not validated.
Attributes whose name has a leading underscore are not treated as fields by Pydantic, and are not included in the model schema. Instead, these are converted into a "private attribute" which is not validated or even set during calls to init, model_validate, etc.
I am thinking a warning might be useful when trying to modify a frozen model but the red underline might be too much.
Describe the bug
PyCharm marks private fields as read-only although pydantic docs say that private attributes are not validated.
I am thinking a warning might be useful when trying to modify a frozen model but the red underline might be too much.
To Reproduce
Expected behavior
Private attributes are excluded from such inspection.
Screenshots
Environments (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: