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
A operation between a NDArray[Any] array and an integer, as in the code example, makes Mypy infer the result as numpy.ndarray[Any, numpy.dtype[numpy.signedinteger[Any]]]. This is an error, as the result could also be a floating point array, or even a complex one.
changed the title [-]BUG: Operation with integer type changes the dtype inferred by mypy to signedinteger[/-][+]BUG: `NDArray[Any]` methods ignore overload ambiguity[/+]on Oct 27, 2021
It seems that Pyright currently does not handle overload ambiguity at all,
so I'm concerned this might be more difficult to fix compared to python/mypy#11347.
Activity
[-]BUG: Operation with integer type changes the dtype inferred by mypy to signedinteger[/-][+]BUG: `NDArray[Any]` methods ignore overload ambiguity[/+]BvB93 commentedon Nov 1, 2021
cc @nschloe
Turns out this issue is present in both mypy and pyright: #20265
BvB93 commentedon Nov 1, 2021
For Pyright I opened an issue at microsoft/pyright#2521.
It seems that Pyright currently does not handle overload ambiguity at all,
so I'm concerned this might be more difficult to fix compared to python/mypy#11347.