projects
/
quix0rs-apt-p2p.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Make nodes hashable so they can be used in dictionaries.
[quix0rs-apt-p2p.git]
/
apt_p2p_Khashmir
/
node.py
diff --git
a/apt_p2p_Khashmir/node.py
b/apt_p2p_Khashmir/node.py
index e05e14157a576f9a68245ffb44aceedc40d72369..eff754b318cc5690c41f10470ff678f1a7b28f14 100644
(file)
--- a/
apt_p2p_Khashmir/node.py
+++ b/
apt_p2p_Khashmir/node.py
@@
-139,6
+139,8
@@
class Node:
if type(a) == InstanceType:
a = a.num
return self.num != a
+ def __hash__(self):
+ return hash(self.num)
class TestNode(unittest.TestCase):