diff options
| author | Jordan Wiens <jordan@psifertex.com> | 2020-03-13 11:53:25 -0400 |
|---|---|---|
| committer | Jordan Wiens <jordan@psifertex.com> | 2020-03-13 11:53:25 -0400 |
| commit | 374611c46ff39e7cb0539e0ce61cc8b649739e04 (patch) | |
| tree | 9a4517d1fdc34fd5eb36b8600df8424ae5140d37 /python | |
| parent | a47824a19ae16d084671e4258641b50c10286990 (diff) | |
fixing several broken __hash__ methods
Diffstat (limited to 'python')
| -rw-r--r-- | python/binaryview.py | 6 | ||||
| -rw-r--r-- | python/settings.py | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/python/binaryview.py b/python/binaryview.py index 5fb1c6fa..5444f45b 100644 --- a/python/binaryview.py +++ b/python/binaryview.py @@ -874,7 +874,7 @@ class Segment(object): return ctypes.addressof(self.handle.contents) != ctypes.addressof(other.handle.contents) def __hash__(self): - return hash(self.handle.contents) + return hash(ctypes.addressof(self.handle.contents)) def __len__(self): return core.BNSegmentGetLength(self.handle) @@ -948,7 +948,7 @@ class Section(object): return ctypes.addressof(self.handle.contents) != ctypes.addressof(other.handle.contents) def __hash__(self): - return hash(self.handle.contents) + return hash(ctypes.addressof(self.handle.contents)) def __len__(self): return core.BNSectionGetLength(self.handle) @@ -1048,7 +1048,7 @@ class TagType(object): return ctypes.addressof(self.handle.contents) != ctypes.addressof(other.handle.contents) def __hash__(self): - return hash(self.handle.contents) + return hash(ctypes.addressof(self.handle.contents)) def __repr__(self): return "<tag type %s: %s>" % (self.name, self.icon) diff --git a/python/settings.py b/python/settings.py index 89a11ca1..447604c5 100644 --- a/python/settings.py +++ b/python/settings.py @@ -91,7 +91,7 @@ class Settings(object): return ctypes.addressof(self.handle.contents) != ctypes.addressof(value.handle.contents) def __hash__(self): - return hash((self.instance_id, self.handle)) + return hash((self.instance_id, ctypes.addressof(self.handle.contents))) @property def instance_id(self): |
