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
Given a function with a model_serializer decorator, and that function calls an instance method on the model, when I attempt to run mypy with the pydantic plugin enabled, then I incorrectly see two errors from mypy regarding the types to the call of the instance method.
demo.py:21: error: Missing positional argument "value"in call to "_calculate_is_hot" of "TemperatureModel" [call-arg]
demo.py:21: error: Argument 1 to "_calculate_is_hot" of "TemperatureModel" has incompatible type"int"; expected "TemperatureModel" [arg-type]
demo.py:26: error: Missing positional argument "value"in call to "_calculate_is_hot" of "TemperatureModel" [call-arg]
demo.py:26: error: Argument 1 to "_calculate_is_hot" of "TemperatureModel" has incompatible type"int"; expected "TemperatureModel" [arg-type]
Given the same as above, when I run mypy without the pydantic plugin enabled, mypy evaluates the example correctly with no issues.