constant: equality

This commit is contained in:
Sebastien Bourdeauducq 2012-01-07 12:29:47 +01:00
parent 7b395b565e
commit b6763c28ea
1 changed files with 3 additions and 0 deletions

View File

@ -122,6 +122,9 @@ class Constant(Value):
def __repr__(self): def __repr__(self):
return str(self.bv) + str(self.n) return str(self.bv) + str(self.n)
def __eq__(self, other):
return self.bv == other.bv and self.n == other.n
def _cst(x): def _cst(x):
if isinstance(x, int): if isinstance(x, int):
return Constant(x) return Constant(x)