diff options
| author | Peter LaFosse <peter@vector35.com> | 2021-12-29 09:40:37 -0500 |
|---|---|---|
| committer | Peter LaFosse <peter@vector35.com> | 2021-12-29 09:40:42 -0500 |
| commit | 1378f9605491ebddafae866180d23f89a11614a4 (patch) | |
| tree | d50117613502255a91200ceae89b840852b13076 /python | |
| parent | f53d800b09ca667c55d13327d32d928705f43bb9 (diff) | |
Fix bug in python structure/enum equality
Diffstat (limited to 'python')
| -rw-r--r-- | python/types.py | 31 |
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)) |
