qubes: allow 'property' object comparing with str
This will allow checking if a given name is valid property name, using simple `name in vm.property_list()`. QubesOS/qubes-issues#853
This commit is contained in:
parent
2169075807
commit
3e0f225938
@ -306,6 +306,8 @@ class property(object): # pylint: disable=redefined-builtin,invalid-name
|
||||
return NotImplemented
|
||||
|
||||
def __eq__(self, other):
|
||||
if isinstance(other, str):
|
||||
return self.__name__ == other
|
||||
return isinstance(other, property) and self.__name__ == other.__name__
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user