-
-
Notifications
You must be signed in to change notification settings - Fork 11k
TYP: Error when calling min() or max() on NumPy scalars #27251
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
My guess is that this has to do something with #26942 |
This has to do with the fact that typeshed requires TLDR; I believe that this is actually a typeshed issue |
But I'll try to see whether I can find a workaround |
But as a workaround for your example @DiegoBaldassarMilleuno, you could replace the |
There's a PR with a fix for this now: python/typeshed#12573 So is it OK with you if we close this issue, @DiegoBaldassarMilleuno? |
@jorenham Great, thank you! Yes, I'll close this. |
Describe the issue:
Since NumPy version 2.1.0 both mypy and pyright complain when calling any of the min() or max() builtins on numpy scalars.
The type doesn't matter (int32, int64, float32, float64, ...)
The error does not occur in version 2.0.1.
Reproduce the code example:
Error message:
Python and NumPy Versions:
2.1.0
3.12.5 (main, Aug 6 2024, 19:08:49) [Clang 15.0.0 (clang-1500.3.9.4)]
Type-checker version and settings:
mypy version: 1.11.1 (compiled: yes)
pyright version: 1.1.376
Both run with no extra flags.
Additional typing packages.
No response
The text was updated successfully, but these errors were encountered: