<DKIM> [PATCH] Pass relevant maildir filenames to newmail_hook

Cameron Simpson cs at cskk.id.au
Sat Jul 20 02:10:53 BST 2019

On 19Jul2019 01:18, Nicolas Sebrecht <nicolas.s-dev at laposte.net> wrote:
>On Thu, Jul 18, 2019 at 01:34:46PM +0300, gwn wrote:
>> So that the hook can implement advanced features that acts on the
>> newly synced mail content.
>>              if self.newmail_hook != None:
>BTW, this check should be merged with the 'have_newmail' check.

Is there a reason this is not "is not" instead of "!=" ?

If you're being Pythonic, a plain "if self.newmail_hook:" would suffice, 
but an equality check with None is very meaningful. It is a singleton, 
so you should be using "is" or falling back to the unadorned 
truthy/falsey bare "if self.newmail_hook:".

Cameron Simpson <cs at cskk.id.au>

More information about the OfflineIMAP-project mailing list