From 2daf526b84a1e746a222668f02578a2fdba0e992 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Mon, 25 Sep 2017 14:07:34 +0200 Subject: o Better implementation of EeVal's __eq__ and __lt__. --- src/ee/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/ee/__init__.py b/src/ee/__init__.py index 0450c40..1eb79d0 100644 --- a/src/ee/__init__.py +++ b/src/ee/__init__.py @@ -60,10 +60,10 @@ class EeVal(object): return self._unit def __eq__(self, other): - return ((self._value, self._unit) == (other._value, other._unit)) + return ((self.__float__(), self._unit) == (other.__float__(), other._unit)) def __lt__(self, other): - return ((self._value, self._unit) < (other._value, other._unit)) + return ((self.__float__(), self._unit) < (other.__float__(), other._unit)) def __str__(self): return eng_str(self.__float__(), self._unit) -- cgit v1.2.3