From 1378f9605491ebddafae866180d23f89a11614a4 Mon Sep 17 00:00:00 2001 From: Peter LaFosse Date: Wed, 29 Dec 2021 09:40:37 -0500 Subject: Fix bug in python structure/enum equality --- python/types.py | 31 ------------------------------- 1 file changed, 31 deletions(-) (limited to 'python') diff --git a/python/types.py b/python/types.py index 62680906..7344b8aa 100644 --- a/python/types.py +++ b/python/types.py @@ -1911,17 +1911,6 @@ class StructureType(Type): if core is not None: core.BNFreeStructure(self.struct_handle) - def __eq__(self, other): - if not isinstance(other, self.__class__): - return NotImplemented - assert other._handle is not None - return ctypes.addressof(self.struct_handle.contents) == ctypes.addressof(other._handle.contents) - - def __ne__(self, other): - if not isinstance(other, self.__class__): - return NotImplemented - return not (self == other) - def __hash__(self): return hash(ctypes.addressof(self.struct_handle.contents)) @@ -2048,15 +2037,6 @@ class EnumerationType(IntegerType): # def __repr__(self): # return "" % repr(self.members) - def __eq__(self, other): - if not isinstance(other, self.__class__): - return NotImplemented - return ctypes.addressof(self.enum_handle.contents) == ctypes.addressof(other.enum_handle.contents) - - def __ne__(self, other): - if not isinstance(other, self.__class__): - return NotImplemented - return not (self == other) def __hash__(self): return hash(ctypes.addressof(self.enum_handle.contents)) @@ -2310,17 +2290,6 @@ class NamedTypeReferenceType(Type): name = " " + str(name.name) return f"{self.get_string_before_name()}{name}{self.get_string_after_name()}" - def __eq__(self, other): - if not isinstance(other, self.__class__): - return NotImplemented - assert other._handle is not None - return ctypes.addressof(self.ntr_handle.contents) == ctypes.addressof(other._handle.contents) - - def __ne__(self, other): - if not isinstance(other, self.__class__): - return NotImplemented - return not (self == other) - def __hash__(self): return hash(ctypes.addressof(self.ntr_handle.contents)) -- cgit v1.3.1