You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this code, the two if-blocks are NOT equivalent:
def f(x):
# x is a np.ndarray with at least 2 dimensions
return x[0, 0] > 0
x = np.eye(2)
a = f(x)
if a == True:
print("a==True")
if a is True:
print("a is True")
assert(False)
What's going on is type(a)==numpy.bool_ which can be compared to True/False via == but it is not referentially the same.
The text was updated successfully, but these errors were encountered:
Using ruff 0.0.265.
In this code, the two if-blocks are NOT equivalent:
What's going on is
type(a)==numpy.bool_
which can be compared to True/False via==
but it is not referentially the same.The text was updated successfully, but these errors were encountered: