[PATCH 3/8] Re: add sync_this variable to all Folder() instances

Nicolas Sebrecht nicolas.s-dev at laposte.net
Sat Sep 3 13:52:34 BST 2011


On Mon, Aug 29, 2011 at 04:00:12PM +0200, Sebastian Spaeth wrote:

> diff --git a/offlineimap/repository/IMAP.py b/offlineimap/repository/IMAP.py
> index 68eb637..11ec25b 100644
> --- a/offlineimap/repository/IMAP.py
> +++ b/offlineimap/repository/IMAP.py

<...>

> @@ -324,7 +327,7 @@ class IMAPRepository(BaseRepository):
>                  
>          retval.sort(lambda x, y: self.foldersort(x.getvisiblename(), y.getvisiblename()))
>          self.folders = retval
> -        return retval
> +        return self.folders

I'm a bit sceptic, here. My questions are :
- can we build self.folders directly all along the method?
- do we need the temporary 'retval' variable in the first place
  (concurrent access or whatever)?
- if 'retval' is needed, _when_ should it be saved as attribute? Is the
  last statement of the method the real good place to do so?

-- 
Nicolas Sebrecht




More information about the OfflineIMAP-project mailing list