1.1 --- a/micropython/rsvp.py Sun Aug 21 14:24:28 2011 +0200
1.2 +++ b/micropython/rsvp.py Sun Aug 21 21:38:56 2011 +0200
1.3 @@ -306,6 +306,9 @@
1.4 self.target = target
1.5 self.source = source
1.6
1.7 + def get_details(self):
1.8 + return self.__class__, self.attr, self.working, self.target, self.source
1.9 +
1.10 def copy(self):
1.11 return self.__class__(self.attr, self.working, self.target, self.source)
1.12
1.13 @@ -316,6 +319,15 @@
1.14 self.format_source(),
1.15 self.format_target())
1.16
1.17 + def __hash__(self):
1.18 + return hash(self.get_details())
1.19 +
1.20 + def __eq__(self, other):
1.21 + return self.get_details() == other.get_details()
1.22 +
1.23 + def __ne__(self, other):
1.24 + return not self.__eq__(other)
1.25 +
1.26 def format_operand(self):
1.27 operand = self.get_operand()
1.28 return repr(operand)