-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
TYP: np.mod(npt.NDArray, Any)
is Any
in 2.2.2 while it wasn't in 2.2.1
#28192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thanks for reporting this! This actually wasn't intentional. I'm able to reproduce this, but only with mypy, and e.g. Pyright reports the following:
But I can't explain why mypy is behaving this way. There's only one overload that return numpy/numpy/_typing/_ufunc.pyi Lines 175 to 228 in fd8a68e
So I would have expected mypy to use the 2nd or 3rd overload instead, and return But either way, for the majority of users, I don't expect that this will lead to any issues. In general, I would advise to avoid using So if you're alright with it, I'll close this issue, as it appears to be caused by a bug in mypy (and only mypy). |
Describe the issue:
numpy 2.2.2 reveals a different type for
np.mod(npt.NDArray, Any)
than 2.2.1. This looks like a result of #28176. Please close if this is an intended change.Reproduce the code example:
Error message:
Python and NumPy Versions:
Numpy 2.2.2 vs 2.2.1
Type-checker version and settings:
mypy 1.14.1 (compiled: yes)
Additional typing packages.
No response
The text was updated successfully, but these errors were encountered: