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 17:03:51 +0100

To: Justus Winter, notmuch@notmuchmail.org

Cc:

From: Sebastian Spaeth


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.


Makes sense, pushed. It shouldn't cause the breaking of existing
clients... (famous last words)

Sebastian
part-000.sig (application/pgp-signature)

Thread: