-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Update np.bool
to be an alias to np.bool_
and un-deprecate it
#22021
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
Should we do the same for |
+1 from me, |
In general, will |
Hi, if this issue is untaken, I would like to have this as my first issue. Can I please get some pointers on where to start? |
Hi, I come from #23494. For now, to avoid confussion, perhaps the text of the Provides more information about what is going on, and seems less confusing/conflicting when paired with the IMO, the confussion comes mainly from the current wording. The warning states that |
>>> np.bool
<class 'numpy.bool'>
>>> np.bool_
<class 'numpy.bool'>
This wasn't done. Can still be done at any time but isn't a blocker for 2.0, so I'll open a new issue for it now to not forget about it. Closing this one to mark that the issue with |
What is the purpose of |
It's a different scalar that behaves slightly differently (there are two reasons for this, historically because numpy scalars pretend to be arrays in part, and in part because Python bools behave more like ints sometimes.) EDIT: and no, as |
Since NumPy 1.20.0,
np.bool
is deprecated (together withnp.int
andnp.float
). We'd like to keepnp.bool
though, because it's a better name thannp.bool_
and is unambiguous.There was a long email thread on this topic: https://mail.python.org/archives/list/[email protected]/thread/NZWX22G5L7I5LOMKQ7HIRECUZXV6NA34/#NZWX22G5L7I5LOMKQ7HIRECUZXV6NA34. The approach @seberg suggested there was:
np.bool
again (butfrom numpy import *
is a problem?)np.bool is np.bool_
at some point in the (far) future.np.bool
has now been deprecated for four releases, so it's time to take the next step in the next release (1.24.0).The text was updated successfully, but these errors were encountered: