From: Fredrik Tolf Date: Sun, 6 Jun 2021 00:09:40 +0000 (+0200) Subject: Make currency values hashable. X-Git-Url: http://dolda2000.com/gitweb/?p=fulbank.git;a=commitdiff_plain;h=619e377ba4263dc5ccdb710ae2e13388e7ed21e9 Make currency values hashable. --- diff --git a/fulbank/currency.py b/fulbank/currency.py index 547acb9..0c5660c 100644 --- a/fulbank/currency.py +++ b/fulbank/currency.py @@ -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)