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
{{ message }}
Repository navigation
Make Settings attributes warn on *assign*, not on *access* (or reset) #89
Settings get read internally and assigning them is the user facing API.
Therefore pydantic’s behavior of warning on access (which is also triggered by reset btw.) but not on assignment doesn’t fit and we should change that.
I think that would fit well as part of pydantic/pydantic#8922. Should we try to implement this upstream, e.g. as a model_config option deprecation_warning_on: Literal["get", "set", "get_and_set"]?
So if we can get hold of Pydantic folks and some clear go-ahead that this is wanted (and that a good design exists) then yeah, otherwise I feel like it’ll take a while.
But it’s not super important anyway. I think if we suppress the warning on reset right now, we’re in a good state too, since people probably set settings before using them and then see the warning.
Activity
ilia-kats commentedon Sep 10, 2026
I think that would fit well as part of pydantic/pydantic#8922. Should we try to implement this upstream, e.g. as a
model_configoptiondeprecation_warning_on: Literal["get", "set", "get_and_set"]?flying-sheep commentedon Sep 10, 2026
Good point! this comment asks exactly for direction about that and didn’t get an answer: pydantic/pydantic#8922 (comment)
So if we can get hold of Pydantic folks and some clear go-ahead that this is wanted (and that a good design exists) then yeah, otherwise I feel like it’ll take a while.
But it’s not super important anyway. I think if we suppress the warning on
resetright now, we’re in a good state too, since people probably set settings before using them and then see the warning.ilia-kats commentedon Sep 11, 2026
The Pydantic changes required to make this work are actually fairly minimal: pydantic/pydantic#13797.