From 83ce033d6413b44bc30d52043b138b449b2db3c2 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Mon, 25 Sep 2017 14:48:05 +0200 Subject: o Making EeVal hashable. --- src/ee/__init__.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/ee/__init__.py b/src/ee/__init__.py index 1eb79d0..d3885c3 100644 --- a/src/ee/__init__.py +++ b/src/ee/__init__.py @@ -59,6 +59,9 @@ class EeVal(object): def unit(self): return self._unit + def __hash__(self): + return hash((self.__float__(), self._unit)) + def __eq__(self, other): return ((self.__float__(), self._unit) == (other.__float__(), other._unit)) -- cgit v1.2.3