[PATCH] Replace dictionary iteration methods

Nicolas Sebrecht nicolas.s-dev at laposte.net
Mon May 16 22:24:07 BST 2016


On Mon, May 16, 2016 at 07:48:50PM +0200, Łukasz Żarnowiecki wrote:
> Signed-off-by: Łukasz Żarnowiecki <dolohow at outlook.com>
> ---
> 
> This patch differs from the previous one that it does not blindly wrap
> all dictionaries with "list" while looping.  This is only necessary when
> the dictionary will be later modified inside of this loop.  Python3 will
> will rise a RuntimeError exception.

I didn't check if all the cases are handled. Neither did I check if the
list() is used where it actually matters. I'm pretty sure this patch is
not introducing issues. Applied.

>  offlineimap/folder/GmailMaildir.py | 6 +++---
>  offlineimap/folder/Maildir.py      | 4 ++--
>  offlineimap/folder/UIDMaps.py      | 4 ++--
>  offlineimap/init.py                | 2 +-
>  offlineimap/repository/Base.py     | 4 ++--
>  5 files changed, 10 insertions(+), 10 deletions(-)

Much lighter than the previous version. Thank you!

-- 
Nicolas Sebrecht




More information about the OfflineIMAP-project mailing list