[PATCH 2/2] python: make the result of Message.get_replies() more pythonic
Tomi Ollila
tomi.ollila at iki.fi
Mon Jan 2 05:15:01 PST 2012
On Wed, 21 Dec 2011 14:15:02 +0100, Justus Winter <4winter at informatik.uni-hamburg.de> wrote:
> Formerly Message.get_replies() returned an iterator or None forcing
> users to check the result before iterating over it leading to strange
> looking code at the call site.
>
> Fix this flaw by adding an EmptyMessagesResult class that behaves like
> the Messages class but immediatly raises StopIteration if used as an
> iterator and returning objects of this type from Message.get_replies()
> to indicate that there are no replies.
> ---
> bindings/python/notmuch/message.py | 22 +++++++++++++++-------
> 1 files changed, 15 insertions(+), 7 deletions(-)
LGTM, but does this break any current software using this API ?
Tomi
More information about the notmuch
mailing list