From a078e1f61706ffa6ab79cb16238d53e3bd427955 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Wed, 29 Jul 2020 03:50:11 +0200 Subject: [PATCH] Make Label() object hashable Since it got custom __eq__ function, __hash__ needs to be implemented too. Otherwise it can't be used as a key in dict. --- qubesadmin/label.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/qubesadmin/label.py b/qubesadmin/label.py index 641ee6d..bd2645d 100644 --- a/qubesadmin/label.py +++ b/qubesadmin/label.py @@ -80,3 +80,6 @@ class Label(object): if isinstance(other, Label): return self.name == other.name return NotImplemented + + def __hash__(self): + return hash(self.name)