mirror of
https://github.com/beetbox/beets.git
synced 2025-12-23 00:54:03 +01:00
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:
parent
4b2c4ced6c
commit
4413e2ed94
1 changed files with 3 additions and 0 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue