summaryrefslogtreecommitdiff
path: root/alot
diff options
context:
space:
mode:
authorLucas Hoffmann <l-m-h@web.de>2017-08-20 11:47:55 +0200
committerLucas Hoffmann <l-m-h@web.de>2017-08-20 12:09:58 +0200
commit20dab95640592bd4f539a8a781f0c80c21cc5708 (patch)
treef7786072840fb188b25c1d913a1d17676dbb4d03 /alot
parenta91ee3f8592f7abcb405dc30ef8e8279dc9a09fd (diff)
Use a tuple to build a hash value
The old implementation would raise an error when the translated tag string was a unicode string (might be defined as an abbreviation in the users config). The official docs suggest this kind of implementation: https://docs.python.org/3/reference/datamodel.html#object.__hash__
Diffstat (limited to 'alot')
-rw-r--r--alot/widgets/globals.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/alot/widgets/globals.py b/alot/widgets/globals.py
index f602add0..6ce29827 100644
--- a/alot/widgets/globals.py
+++ b/alot/widgets/globals.py
@@ -290,7 +290,7 @@ class TagWidget(urwid.AttrMap):
self.translated = representation['translated']
self.hidden = self.translated == ''
self.txt = urwid.Text(self.translated, wrap='clip')
- self.__hash = hash('{}_{}'.format(self.translated, self.txt))
+ self.__hash = hash((self.translated, self.txt))
normal_att = representation['normal']
focus_att = representation['focussed']
self.attmaps = {'normal': normal_att, 'focus': focus_att}