Open Joshix-1 opened 7 months ago
@Joshix-1 to help get this triaged, I respectfully suggest changing the title of this bug to something more specific, e.g., "int.__truediv__()
accepted by Protocol
that effectively calls for Real numbers"
Somewhat related: #205
Bug Report
Mypy allows type-unsafe code.
To Reproduce
https://mypy-play.net/?mypy=1.0.0&python=3.10&gist=ab7449de421b39046dadf9c022d82e77
Expected Behavior
int should not satisfy SupportsSelfDivision. Runtime type should be the same as mypy reveals. Or there should be an error that int is not SupportsSelfDivision
Actual Behavior
int is SupportsSelfDivision. Mypy doesn't complain and says it's int even though it's float.
Your Environment
mypy Playground + local
mypy.ini
(and other config files): -