From: martin f. krafft Date: Thu, 24 Aug 2023 13:22:23 +0000 (+1200) Subject: buildmimetree.py: make Multipart nodes hashable X-Git-Url: https://git.madduck.net/etc/neomutt.git/commitdiff_plain/9347b03add9503a0c059940f14f0defcdc1bbaf5 buildmimetree.py: make Multipart nodes hashable --- diff --git a/.config/neomutt/buildmimetree.py b/.config/neomutt/buildmimetree.py index 02d668b..97ada97 100755 --- a/.config/neomutt/buildmimetree.py +++ b/.config/neomutt/buildmimetree.py @@ -252,6 +252,9 @@ class Multipart( def __str__(self): return f" children={len(self.children)}" + def __hash__(self): + return hash(str(self.subtype) + "".join(str(self.children))) + def filewriter_fn(path, content, mode="w", **kwargs): with open(path, mode, **kwargs) as out_f: