From f63454698099d4ee0998aba28dbd8d90e6b686a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20=C5=BBarnowiecki?= Date: Fri, 5 Aug 2016 18:28:53 +0000 Subject: [PATCH] explicitly set __hash__ of Base class to None MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This suppressing the warning generated when running offlineimap on python2 with -3 switch: offlineimap/folder/Base.py:29: DeprecationWarning: Overriding __eq__ blocks inheritance of __hash__ in 3.x Since this object is mutable it should not be hashable. From Python documentation[1]: A class that overrides __eq__() and does not define __hash__() will have its __hash__() implicitly set to None. Therefore old behaviour is preserved. [1] https://docs.python.org/3/reference/datamodel.html Signed-off-by: Łukasz Żarnowiecki Signed-off-by: Nicolas Sebrecht --- offlineimap/folder/Base.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/offlineimap/folder/Base.py b/offlineimap/folder/Base.py index b691c54..0544b3d 100644 --- a/offlineimap/folder/Base.py +++ b/offlineimap/folder/Base.py @@ -27,6 +27,8 @@ import offlineimap.accounts class BaseFolder(object): + __hash__ = None + def __init__(self, name, repository): """ :param name: Path & name of folder minus root or reference