Re: [PATCH 2/2] python: make the result of Message.get_replies() more pythonic

Subject: Re: [PATCH 2/2] python: make the result of Message.get_replies() more pythonic

Date: Mon, 02 Jan 2012 15:15:01 +0200

To: Justus Winter, notmuch@notmuchmail.org

Cc:

From: Tomi Ollila


On Wed, 21 Dec 2011 14:15:02 +0100, Justus Winter <4winter@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


Thread: