summaryrefslogtreecommitdiff
path: root/python/types.py
diff options
context:
space:
mode:
authorPeter LaFosse <peter@vector35.com>2021-12-29 09:40:37 -0500
committerPeter LaFosse <peter@vector35.com>2021-12-29 09:40:42 -0500
commit1378f9605491ebddafae866180d23f89a11614a4 (patch)
treed50117613502255a91200ceae89b840852b13076 /python/types.py
parentf53d800b09ca667c55d13327d32d928705f43bb9 (diff)
Fix bug in python structure/enum equality
Diffstat (limited to 'python/types.py')
-rw-r--r--python/types.py31
1 files changed, 0 insertions, 31 deletions
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 "<enum: %s>" % 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))