-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
NPY001 should not replace np.bool
by bool
(at least in type hints)
#11093
Comments
See also numpy/numpy#25080 |
Is this considered "recommended" by NumPy, or is it a bug or limitation in the type definitions? |
\cc @mtsokol if you know! |
This. See https://numpy.org/devdocs/release/2.0.0-notes.html#changes, 5th bullet in "Changes". |
So, it seems |
fyi, numpy 2 will not be released until June 16 (numpy/numpy#24300 (comment)). |
Right, I'll adjust the NPY001 to NumPy 2.0 changes to avoid a conflict with the NPY201 rule (namely |
I opened a PR for it: #11735 |
@bersbersbers FYI we noticed that the new |
Hi! This PR addresses #11093. It skips `np.bool` and `np.long` replacements as both of these names were reintroduced in NumPy 2.0 with a different meaning (numpy/numpy#24922, numpy/numpy#25080). With this change `NPY001` will no longer conflict with `NPY201`. For projects using NumPy 1.x `np.bool` and `np.long` has been deprecated and removed long time ago, and accessing them yields an informative error message.
I think we can close it as resolved. |
Yes, verified 0.4.8. Thanks! |
bug.py
For
mypy
v1.9.0, onlynp.bool
is acceptable:However,
NPY001
does not like that solution:--fix
givesKeywords: numpy 2, deprecation, bool, bool_
ruff 0.4.1
mypy 1.9.0
numpy 2.0.0rc1
The text was updated successfully, but these errors were encountered: