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
Please provide more information to help us understand the issue:
Are you reporting a bug, or opening a feature request?
Bug.
Please insert below the code you are checking with mypy,
or a mock-up repro if the source is private. We would appreciate
if you try to simplify your case to a minimal repro.
In the lambda in average_position(), mypy incorrectly (?) determines the type as Callable[[Point], float], while using the NumPy function np.multiply() (which does the same thing) gives no error. Both functions output the same correct value.
What is the behavior/output you expect?
There should be no error.
What are the versions of mypy and Python you are using?
Do you see the same issue after installing mypy from Git master?
mypy==0.740
Python 3.8.0
What are the mypy flags you are using? (For example --strict-optional)
It looks like #8019 didn't actually fix this issue, at least Jukka's simple example above still fails. It accidentally passes in tests (see testOpWithInheritedFromAny) because in builtins fixtures float doesn't have __add__(). I am going to mark it xfail in #14077 (since I need that __add__() that actually present in real builtins stubs, for my tests).
Note: if you are reporting a wrong signature of a function or a class in
the standard library, then the typeshed tracker is better suited
for this report: https://github.com/python/typeshed/issues
Please provide more information to help us understand the issue:
Bug.
or a mock-up repro if the source is private. We would appreciate
if you try to simplify your case to a minimal repro.
Mypy gives the errors below:
In the lambda in
average_position()
, mypy incorrectly (?) determines the type asCallable[[Point], float]
, while using the NumPy functionnp.multiply()
(which does the same thing) gives no error. Both functions output the same correct value.What is the behavior/output you expect?
There should be no error.
What are the versions of mypy and Python you are using?
Do you see the same issue after installing mypy from Git master?
I am unsure if this is actually an error, or if I've done something wrong somewhere, but both functions run and output correctly.
The text was updated successfully, but these errors were encountered: