Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign up`numpy.bool_(True) is True` evaluates to `False` #5942
Comments
|
An instance of the type then cannot be the same object as |
|
The pep recommendation doesn't mean that nothing is allowed to compare == See also: 1 == True, 1 is True
|
|
Sorry for the bad example, better would have been: Thanks for the explanation. |
|
Ah, yes, it doesn't help that the numpy types like np.bool_ often disguise
|
|
Actually, the PEP8 recommendation for
|
|
Changing the repr sounds sensible except that doctests may be an problem... |
Even though
numpy.bool_(True) == Trueevaluates toTrue. Doesn't this violate the PEP8 recommendation that ``Comparisons to singletons like None should always be done with is or is not, never the equality operators.`?Sorry, if this is a dupe. I searched for bool comarison and pep8 and could not find an relevant issue.
numpy.__version__: 1.9.0.dev-297f54b