diff options
Diffstat (limited to 'python/settings.py')
| -rw-r--r-- | python/settings.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/python/settings.py b/python/settings.py index 447604c5..3b92ec5d 100644 --- a/python/settings.py +++ b/python/settings.py @@ -80,15 +80,15 @@ class Settings(object): if self.handle is not Settings.handle and self.handle is not None: core.BNFreeSettings(self.handle) - def __eq__(self, value): - if not isinstance(value, Settings): - return False - return ctypes.addressof(self.handle.contents) == ctypes.addressof(value.handle.contents) + def __eq__(self, other): + if not isinstance(other, self.__class__): + return NotImplemented + return ctypes.addressof(self.handle.contents) == ctypes.addressof(other.handle.contents) - def __ne__(self, value): - if not isinstance(value, Settings): - return True - return ctypes.addressof(self.handle.contents) != ctypes.addressof(value.handle.contents) + def __ne__(self, other): + if not isinstance(other, self.__class__): + return NotImplemented + return not (self == other) def __hash__(self): return hash((self.instance_id, ctypes.addressof(self.handle.contents))) |
