Make currency values hashable.
[fulbank.git] / fulbank / currency.py
index 547acb9..0c5660c 100644 (file)
@@ -143,3 +143,6 @@ class value(object):
         if self.currency != other.currency:
             raise ValueError("cannot compare %s with %s" % (self.currency.symbol, other.currency.symbol))
         return self.amount >= other.amount
+
+    def __hash__(self):
+        return hash(self.amount) + hash(self.currency)