qubes: add property ordering

This commit is contained in:
Marek Marczykowski-Górecki 2017-02-19 00:04:23 +01:00
parent be53db4db9
commit d68499f17f
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -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__