Skip to content
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

DEP: np.dtype('float64') == None and np.dtype(None) should be deprecated #18434

Open
paris0120 opened this issue Feb 17, 2021 · 2 comments
Open

Comments

@paris0120
Copy link

output: True
version: '1.18.5'
System: Windows 10

@eric-wieser
Copy link
Member

eric-wieser commented Feb 17, 2021

Confirmed in 1.19.4

>>> np.dtype('float64') == None
True

thankfully

>>> np.dtype('float64') is None
False

I think this is unfortunately by design, since np.dtype(None) gives np.float64. Perhaps we should deprecate passing None, which would also make this comparison give a warning.

@seberg seberg changed the title np.dtype('float64')==None DEP: np.dtype('float64') == None and np.dtype(None) should be deprecated Feb 24, 2021
@seberg
Copy link
Member

seberg commented Feb 24, 2021

This ties in with other things about hashing and richcompare (e.g. gh-5345 and gh-).

But I think None specifically, together with np.dtype(None) itself could be deprecated. We have two versions for dtype conversions right now, one with default (accepting None) and one without. Apparently, these are two examples where we use the wrong version.

If anyone wants to look into this, i don't think it should be particularly difficult, although its all in C and requires adding deprecation tests, etc. so it is definitely not very easy either.

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

No branches or pull requests

3 participants