From: Tomi Ollila <tomi.ollila@iki.fi>
To: Justus Winter <4winter@informatik.uni-hamburg.de>,
notmuch@notmuchmail.org
Subject: Re: [PATCH 2/2] python: make the result of Message.get_replies() more pythonic
Date: Mon, 02 Jan 2012 15:15:01 +0200 [thread overview]
Message-ID: <yf6ipkuz1nu.fsf@taco2.nixu.fi> (raw)
In-Reply-To: <1324473302-10869-3-git-send-email-4winter@informatik.uni-hamburg.de>
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
next prev parent reply other threads:[~2012-01-02 13:15 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-05 1:42 python: unpythonic result of Message.get_replies() Justus Winter
2011-11-02 7:29 ` Sebastian Spaeth
2011-12-21 13:15 ` Justus Winter
2011-12-21 13:15 ` [PATCH 1/2] python: refactor print_messages into format_messages and print_messages Justus Winter
2012-01-02 13:13 ` Tomi Ollila
2012-01-02 15:56 ` Sebastian Spaeth
2011-12-21 13:15 ` [PATCH 2/2] python: make the result of Message.get_replies() more pythonic Justus Winter
2012-01-02 13:15 ` Tomi Ollila [this message]
2012-01-02 16:03 ` Sebastian Spaeth
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=yf6ipkuz1nu.fsf@taco2.nixu.fi \
--to=tomi.ollila@iki.fi \
--cc=4winter@informatik.uni-hamburg.de \
--cc=notmuch@notmuchmail.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).