make Distance a hashable object

It previously was hashable, until we added `__eq__`, so we must now do
it explicitly
This commit is contained in:
Johnny Robeson 2016-06-14 02:01:41 -04:00
parent 4b2c4ced6c
commit 4413e2ed94

View file

@ -356,6 +356,9 @@ class Distance(object):
key=lambda key_and_dist: (-key_and_dist[1], key_and_dist[0])
)
def __hash__(self):
return id(self)
def __eq__(self, other):
return self.distance == other