From b13aee066849f21e0d0acd3106283ce1d4014fdd Mon Sep 17 00:00:00 2001 From: Siu Kwan Lam Date: Thu, 28 Mar 2013 22:05:12 -0500 Subject: [PATCH] Two llvm wrapped instances are the same if they point to the same thing --- llvmpy/capsule.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/llvmpy/capsule.py b/llvmpy/capsule.py index e3b9537..9c1e86a 100644 --- a/llvmpy/capsule.py +++ b/llvmpy/capsule.py @@ -76,7 +76,7 @@ class Capsule(object): return False def __hash__(self): - return super(Capsule, self).__hash__() + return hash((self.pointer, self.name)) def __ne__(self, other): return not (self == other) @@ -174,13 +174,13 @@ class Wrapper(object): return self._capsule.capsule def __hash__(self): - return super(Wrapper, self).__hash__() + return hash(self._capsule) def __eq__(self, other): return self._capsule == other._capsule def __ne__(self, other): - return self._capsule != other._capsule + return not(self == other) def _downcast(self, newcls): return downcast(self, newcls)