From d68499f17f161d60d4ba0873e5c2d3f21db7ce54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Sun, 19 Feb 2017 00:04:23 +0100 Subject: [PATCH] qubes: add property ordering --- qubes/__init__.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/qubes/__init__.py b/qubes/__init__.py index 4928fbac..d33e860e 100644 --- a/qubes/__init__.py +++ b/qubes/__init__.py @@ -299,6 +299,11 @@ class property(object): # pylint: disable=redefined-builtin,invalid-name def __hash__(self): return hash(self.__name__) + def __lt__(self, other): + if isinstance(other, property): + return self.__name__ < other.__name__ + else: + return self < other def __eq__(self, other): return isinstance(other, property) and self.__name__ == other.__name__