From 52f915d7070b2e7be69f68d58890d57130e0ede6 Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Thu, 18 Apr 2019 02:45:43 -0400 Subject: [PATCH] py3: allow SearchResult instances to be hashed --- src/calibre/gui2/store/search_result.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/calibre/gui2/store/search_result.py b/src/calibre/gui2/store/search_result.py index 0f870ee770..d1d4b33411 100644 --- a/src/calibre/gui2/store/search_result.py +++ b/src/calibre/gui2/store/search_result.py @@ -33,6 +33,9 @@ class SearchResult(object): def __eq__(self, other): return self.title == other.title and self.author == other.author and self.store_name == other.store_name and self.formats == other.formats + def __hash__(self): + return id(self) + def __str__(self): items = [] for x in 'store_name title author price formats detail_item cover_url'.split():