Hashable Module and fix Module __eq__
This commit is contained in:
parent
6578412437
commit
bc12aae8c1
1 changed files with 4 additions and 4 deletions
|
|
@ -452,12 +452,12 @@ class Module(llvm.Wrapper):
|
|||
"""
|
||||
return str(self._ptr)
|
||||
|
||||
def __hash__(self):
|
||||
return id(self._ptr)
|
||||
|
||||
def __eq__(self, rhs):
|
||||
assert isinstance(rhs, Module), type(rhs)
|
||||
if isinstance(rhs, Module):
|
||||
return str(self) == str(rhs)
|
||||
else:
|
||||
return False
|
||||
return self._ptr == rhs._ptr
|
||||
|
||||
def __ne__(self, rhs):
|
||||
return not (self == rhs)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue