From 4413e2ed94bb2ab9e89c6aa3c9942793b9feb62f Mon Sep 17 00:00:00 2001 From: Johnny Robeson Date: Tue, 14 Jun 2016 02:01:41 -0400 Subject: [PATCH] make Distance a hashable object It previously was hashable, until we added `__eq__`, so we must now do it explicitly --- beets/autotag/hooks.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/beets/autotag/hooks.py b/beets/autotag/hooks.py index 92a7b8e29..0d9030b2c 100644 --- a/beets/autotag/hooks.py +++ b/beets/autotag/hooks.py @@ -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