Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id D19D9431FD0 for ; Thu, 2 Jun 2011 07:37:59 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.09 X-Spam-Level: X-Spam-Status: No, score=-0.09 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, T_MIME_NO_TEXT=0.01] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4MWb-GKQqcPE for ; Thu, 2 Jun 2011 07:37:59 -0700 (PDT) Received: from homiemail-a21.g.dreamhost.com (caiajhbdcagg.dreamhost.com [208.97.132.66]) by olra.theworths.org (Postfix) with ESMTP id 4EB36431FB6 for ; Thu, 2 Jun 2011 07:37:59 -0700 (PDT) Received: from homiemail-a21.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a21.g.dreamhost.com (Postfix) with ESMTP id 7E21530007B; Thu, 2 Jun 2011 07:37:58 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=SSpaeth.de; h=from:to:subject :in-reply-to:references:date:message-id:mime-version: content-type; q=dns; s=sspaeth.de; b=GwmzTx/9hnNKurShq3CNJGZ4hwQ 47WSTA/klercWrLIIJ+yd0G12AguNmU201p+Rar00VzqQuvzM73l56wlWg+i6cgw 471qgcGSgZc6Nb/2r9wMDK6L7kDZiK0DnW+SoOO9Hboq6VhEgWioadvduBXSAM8/ ygOeFl8Wcbuab8mo= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=SSpaeth.de; h=from:to :subject:in-reply-to:references:date:message-id:mime-version: content-type; s=sspaeth.de; bh=FqgPaOmK1r+ABjTJIuxXYtvQz6I=; b=m 2cr4Yp+PmZcWqpridgMR0CbwDbCjhSoH8TuapbP2mbEBbnLxSZfYdpY31as4tZMp cTJHMe4cDAvb0Vpf0Clft3bshlKmzCjfv95kxPn9NPdhH/IkxNXAKmX9qzEDufYW EfmiU4SakSIqHvE2ZBSSUzwAKjp0N+vaj+jhWP5Bdk= Received: from spaetzbook.sspaeth.de (unknown [194.204.5.155]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: fax@sspaeth.de) by homiemail-a21.g.dreamhost.com (Postfix) with ESMTPSA id E5B17300074; Thu, 2 Jun 2011 07:37:56 -0700 (PDT) Received: by spaetzbook.sspaeth.de (sSMTP sendmail emulation); Thu, 02 Jun 2011 16:37:54 +0200 From: Sebastian Spaeth To: Brian May , notmuch Subject: Re: [python] get all messages of a thread In-Reply-To: <87r57cuxgh.fsf@SSpaeth.de> References: <1306588052-sup-9838@brick> <87aae07lxi.fsf@SSpaeth.de> <87r57cuxgh.fsf@SSpaeth.de> User-Agent: Notmuch/0.5-209-gc8b5718 (http://notmuchmail.org) Emacs/23.2.1 (x86_64-pc-linux-gnu) Date: Thu, 02 Jun 2011 16:37:53 +0200 Message-ID: <87oc2guwn2.fsf@SSpaeth.de> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Jun 2011 14:38:00 -0000 --=-=-= On Thu, 02 Jun 2011 16:20:14 +0200, Sebastian Spaeth wrote: > I made the change, and implemented __nonzero__ and removed the len() > method. It just doesn't make sense on 1-time iterators. (I documented > the change in the API docs). Sorry if this breaks existing code. FYI OK, I just pushed a change that adds the __nonzero__ function thus making: t=Threads() if t: len(t) work, but I did not pull the len() function out. The explicit "if t" test is however not needed for t = q.search_threads() for thread in t: print thread works just fine with empty results. Sebastian --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iEYEARECAAYFAk3noEIACgkQVYX1jMgnoGLnSACfR1zo53KeCRhm7ZEuVjU5yaiM 2hIAnRXG7oHQwyHcZZZx2ceMU7QKsXnP =lO7U -----END PGP SIGNATURE----- --=-=-=--