fhdl/structure: make all values hashable

This commit is contained in:
Sebastien Bourdeauducq 2012-11-06 13:51:51 +01:00
parent 3042f047fe
commit 56d4cdeb48
1 changed files with 3 additions and 3 deletions

View File

@ -109,6 +109,9 @@ class Value:
def eq(self, r):
return _Assign(self, r)
def __hash__(self):
return id(self)
class _Operator(Value):
def __init__(self, op, operands):
@ -168,9 +171,6 @@ class Signal(Value):
def __len__(self):
return self.bv.width
def __hash__(self):
return id(self)
def __repr__(self):
return "<Signal " + (self.backtrace[-1][0] or "anonymous") + " at " + hex(id(self)) + ">"