[PATCH] Re: Make flags a set rather than a list

Nicolas Sebrecht nicolas.s-dev at laposte.net
Fri Aug 19 18:06:54 BST 2011


On Tue, Aug 16, 2011 at 12:16:46PM +0200, Sebastian Spaeth wrote:
> As this is essentially what it is, a set of values. This allows as
> to do set arithmetics to see, e.g. the intersection of 2 flag sets 
> rather than clunkily having to do:
> 
> for flag in newflags:
>   if flag not in oldflags:
>     oldflags.append(flag)
> 
> Also some more code documenting.
> 
> Signed-off-by: Sebastian Spaeth <Sebastian at SSpaeth.de>
> ---
> Here is a patch that I want to submit for consideration. Rather than
> treating our flags as an array of characters that we have to sort etc,
> we could simply treat them as a set() of values. This allows to use set
> arithmetic (eg set - subset) and it would help us move to a direction
> where we could use multi-character flags in the future. It would be
> cool to be able to sync all IMAP flags (such as \Junk or \ToDo) at some
> point in the future.

Looks OK.
Merged.

-- 
Nicolas Sebrecht




More information about the OfflineIMAP-project mailing list