Skip to content

Commit

Permalink
fix type comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfikl committed Jul 30, 2023
1 parent c68e074 commit a5fff1b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion arraycontext/container/traversal.py
Original file line number Diff line number Diff line change
Expand Up @@ -965,7 +965,7 @@ def treat_as_scalar(x: Any) -> bool:
elif isinstance(a, np.ndarray) or isinstance(b, np.ndarray):
return map_array_container(lambda x: outer(x, b), a)
else:
if type(a) != type(b):
if type(a) is not type(b):
raise TypeError(
"both arguments must have the same type if they are both "
"non-object-array array containers.")
Expand Down
2 changes: 1 addition & 1 deletion arraycontext/impl/jax/fake_numpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ def array_equal(self, a, b):
false = actx.from_numpy(np.int8(False))

def rec_equal(x, y):
if type(x) != type(y):
if type(x) is not type(y):
return false

try:
Expand Down
2 changes: 1 addition & 1 deletion arraycontext/impl/pyopencl/fake_numpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ def array_equal(self, a, b):
false = actx.from_numpy(np.int8(False))

def rec_equal(x, y):
if type(x) != type(y):
if type(x) is not type(y):
return false

try:
Expand Down
2 changes: 1 addition & 1 deletion arraycontext/impl/pytato/fake_numpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def array_equal(self, a, b):
false = actx.from_numpy(np.int8(False))

def rec_equal(x, y):
if type(x) != type(y):
if type(x) is not type(y):
return false

try:
Expand Down

0 comments on commit a5fff1b

Please sign in to comment.