Added better __eq__ method to Label class

Labels with the same name should not be distinguishable.

fixes QubesOS/qubes-issues#5944
Этот коммит содержится в:
Marta Marczykowska-Górecka 2020-07-09 18:50:03 +02:00
родитель ae39c75867
Коммит 1a4cdba7f7
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 9A752C30B26FD04B

Просмотреть файл

@ -75,3 +75,8 @@ class Label(object):
def __str__(self):
return self._name
def __eq__(self, other):
if isinstance(other, Label):
return self.name == other.name
return NotImplemented