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
Bug Report
It is a relatively common design pattern that a property setter might be more accepting of various inputs and then perform a conversion internally to conform the input to the right type (in fact, this might be the very reason that a @property is used, as opposed to merely storing data in an attribute).
PyRight accepts the following code without warnings or errors. MyPy does not:
q.py:11: error: Incompatible types in assignment (expression has type "float", variable has type "int") [assignment]
Found 1 error in 1 file (checked 1 source file)
Your Environment
Mypy version used: mypy 1.8.0 (compiled: yes)
Mypy command-line flags: none
Mypy configuration options from mypy.ini (and other config files): N/A
Python version used: 3.12.2
The text was updated successfully, but these errors were encountered:
Bug Report
It is a relatively common design pattern that a property setter might be more accepting of various inputs and then perform a conversion internally to conform the input to the right type (in fact, this might be the very reason that a
@property
is used, as opposed to merely storing data in an attribute).PyRight accepts the following code without warnings or errors. MyPy does not:
To Reproduce
Expected Behavior
Accepted without errors or warnings.
Actual Behavior
Your Environment
mypy.ini
(and other config files): N/AThe text was updated successfully, but these errors were encountered: