8000 BUG: `np.dtype("a")` NumPy 2 deprecation seems not properly tested and raising fails. · Issue #26521 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content
8000

BUG: np.dtype("a") NumPy 2 deprecation seems not properly tested and raising fails. #26521

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

Closed
seberg opened this issue May 24, 2024 · 0 comments · Fixed by #26524
Closed

BUG: np.dtype("a") NumPy 2 deprecation seems not properly tested and raising fails. #26521

seberg opened this issue May 24, 2024 · 0 comments · Fixed by #26524
Milestone

Comments

@seberg
Copy link
Member
seberg commented May 24, 2024

The following should either raise the DeprecationWarning properly, or life in the future and raise a TypeError, but it doesn't raise anything:

In [4]: warnings.simplefilter("error")
In [5]: np.dtype("a")
---------------------------------------------------------------------------
DeprecationWarning                        Traceback (most recent call last)
DeprecationWarning: Data type alias `a` was removed in NumPy 2.0. Use `S` alias instead.

The above exception was the direct cause of the following exception:

SystemError                               Traceback (most recent call last)
Cell In[5], line 1
----> 1 np.dtype("a")

SystemError: <class 'numpy.dtype'> returned a result with an exception set

Probably there is no test for it in test_deprecations.py (since those tests automatically try to cover the failure path).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant
0