From 224bdf89e76e8d075aeede5ed3a3eb8cb3ac45ce Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Sat, 4 Aug 2012 20:22:11 +0200 Subject: [PATCH] Math: implement __lt__ and __eq__ in converter.Unit. --- plugins/Math/local/convertcore.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugins/Math/local/convertcore.py b/plugins/Math/local/convertcore.py index c89955891..75d38fa11 100644 --- a/plugins/Math/local/convertcore.py +++ b/plugins/Math/local/convertcore.py @@ -1177,6 +1177,12 @@ class Unit: def __cmp__(self, other): return cmp(self.name, other.name) + def __lt__(self, other): + return self.name < other.name + + def __eq__(self, other): + return self.name == other.name + ############################################################################ # Wrapper functionality #