]> git.cworth.org Git - obsolete/notmuch-old/commitdiff
python: make the result of Message.get_replies() more pythonic
authorJustus Winter <4winter@informatik.uni-hamburg.de>
Wed, 21 Dec 2011 13:15:02 +0000 (14:15 +0100)
committerSebastian Spaeth <Sebastian@SSpaeth.de>
Mon, 2 Jan 2012 16:01:40 +0000 (17:01 +0100)
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.


No differences found