From d8beb904e4e1a27f7cca8ab8be2f8db283765075 Mon Sep 17 00:00:00 2001 From: Alexandru Fikl Date: Sun, 30 Jul 2023 17:27:46 +0300 Subject: [PATCH] fix type comparison --- sumpy/expansion/__init__.py | 2 +- sumpy/expansion/local.py | 2 +- sumpy/kernel.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sumpy/expansion/__init__.py b/sumpy/expansion/__init__.py index d72918eb..dc3ce3ba 100644 --- a/sumpy/expansion/__init__.py +++ b/sumpy/expansion/__init__.py @@ -225,7 +225,7 @@ class ExpansionBase(ABC): def __eq__(self, other): return ( - type(self) == type(other) + type(self) is type(other) and self.kernel == other.kernel and self.order == other.order and self.use_rscale == other.use_rscale) diff --git a/sumpy/expansion/local.py b/sumpy/expansion/local.py index dd083849..7f0607f0 100644 --- a/sumpy/expansion/local.py +++ b/sumpy/expansion/local.py @@ -70,7 +70,7 @@ class LocalExpansionBase(ExpansionBase): def __eq__(self, other): return ( - type(self) == type(other) + type(self) is type(other) and self.kernel == other.kernel and self.order == other.order and self.use_rscale == other.use_rscale diff --git a/sumpy/kernel.py b/sumpy/kernel.py index 1be1dec9..6c50350b 100644 --- a/sumpy/kernel.py +++ b/sumpy/kernel.py @@ -102,9 +102,9 @@ class KernelArgument: def __eq__(self, other): if id(self) == id(other): return True - if not type(self) == KernelArgument: + if type(self) is not KernelArgument: return NotImplemented - if not type(other) == KernelArgument: + if type(other) is not KernelArgument: return NotImplemented return self.loopy_arg == other.loopy_arg -- GitLab