-
-
Notifications
You must be signed in to change notification settings - Fork 12.1k
Closed
Description
np.bool_ causes lots of confusion because it does not compare with builtin bool intuitively.
As mentioned in #5942, #7913 (maybe more as well), changing the __repr__ from
[True, False]
to
[np.bool_(True), np.bool_(False)]
would prevent much of the confusion.
Reproducing code example:
>>> import numpy as np
>>> t, f = np.bool_(True), np.bool_(False)
>>> t, f
(True, False)
>>> True, False
(True, False)
>>> t is True, f is False
(False, False)They are identical. This can be very confusing if you don't know the type of t and f ahead of time.
Numpy/Python version information:
This was tested with Python 3.7 and Numpy version '1.16.1'.
Reactions are currently unavailable