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
The above issue is fixed for getting attributes when using the pydantic mypy plugin, but not for setting attributes
Example Code
classblah(pydantic.BaseModel):
temperature: Optional[int] =pydantic.Field(
..., description="The temperature of the zone"
)
zone: int=pydantic.Field(..., description="The zone number")
myblah=blah(temperature=1, zone=2)
myblah.sdlkjdshljkdsj="wekjhe"<<<# does not generate an errorprint(myblah.aaa) # <<< Generates an error
Hum, are you certain this is an issue on latest? I believe this was fixed in #8651.
Those dunder methods are currently defined in a if not TYPE_CHECKING block, however it might be interesting to use no_type_check, would avoid the extra indentation block
Initial Checks
Description
Related: #245
The above issue is fixed for getting attributes when using the pydantic mypy plugin, but not for setting attributes
Example Code
Python, Pydantic & OS Version
The text was updated successfully, but these errors were encountered: