diff --git a/arraycontext/container/traversal.py b/arraycontext/container/traversal.py index b59fe794..5a4dcf74 100644 --- a/arraycontext/container/traversal.py +++ b/arraycontext/container/traversal.py @@ -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.") diff --git a/arraycontext/impl/jax/fake_numpy.py b/arraycontext/impl/jax/fake_numpy.py index 09558208..27799cfe 100644 --- a/arraycontext/impl/jax/fake_numpy.py +++ b/arraycontext/impl/jax/fake_numpy.py @@ -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: diff --git a/arraycontext/impl/pyopencl/fake_numpy.py b/arraycontext/impl/pyopencl/fake_numpy.py index d989d45a..a379f290 100644 --- a/arraycontext/impl/pyopencl/fake_numpy.py +++ b/arraycontext/impl/pyopencl/fake_numpy.py @@ -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: diff --git a/arraycontext/impl/pytato/fake_numpy.py b/arraycontext/impl/pytato/fake_numpy.py index 14d9a968..6c78d419 100644 --- a/arraycontext/impl/pytato/fake_numpy.py +++ b/arraycontext/impl/pytato/fake_numpy.py @@ -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: