]> git.mxchange.org Git - quix0rs-apt-p2p.git/blobdiff - apt_p2p_Khashmir/node.py
Make nodes hashable so they can be used in dictionaries.
[quix0rs-apt-p2p.git] / apt_p2p_Khashmir / node.py
index e05e14157a576f9a68245ffb44aceedc40d72369..eff754b318cc5690c41f10470ff678f1a7b28f14 100644 (file)
@@ -139,6 +139,8 @@ class Node:
         if type(a) == InstanceType:
             a = a.num
         return self.num != a
         if type(a) == InstanceType:
             a = a.num
         return self.num != a
+    def __hash__(self):
+        return hash(self.num)
 
 
 class TestNode(unittest.TestCase):
 
 
 class TestNode(unittest.TestCase):