<DKIM> [PATCH] Explicitly set __hash__ of Base class to None

Nicolas Sebrecht nicolas.s-dev at laposte.net
Sat Aug 6 00:38:08 BST 2016


> Content-Transfer-Encoding: base64

This base64 tends to be a bit annoying in my workflow. If it's not too
hard to change the encoding on your side I'd rather 8-bit or similar. I
could not find any switch for 'git am' to allow base64 input.

On Fri, Aug 05, 2016 at 06:28:53PM +0000, Łukasz Żarnowiecki wrote:

> 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

Thank you much! Applied.

-- 
Nicolas Sebrecht




More information about the OfflineIMAP-project mailing list