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 A9B6B4196F0 for ; Sun, 21 Mar 2010 13:08:02 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0.8 X-Spam-Level: X-Spam-Status: No, score=0.8 tagged_above=-999 required=5 tests=[BAYES_50=0.8] autolearn=ham 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 D3JCRkzXBAFR for ; Sun, 21 Mar 2010 13:08:00 -0700 (PDT) Received: from homiemail-a15.g.dreamhost.com (caiajhbdcaib.dreamhost.com [208.97.132.81]) by olra.theworths.org (Postfix) with ESMTP id D7D16431FC1 for ; Sun, 21 Mar 2010 13:08:00 -0700 (PDT) Received: from sspaeth.de (unknown [195.190.188.219]) by homiemail-a15.g.dreamhost.com (Postfix) with ESMTPA id B75A676C062; Sun, 21 Mar 2010 13:07:58 -0700 (PDT) Received: by sspaeth.de (sSMTP sendmail emulation); Sun, 21 Mar 2010 21:07:56 +0100 From: "Sebastian Spaeth" To: Ruben Pollan , notmuch@notmuchmail.org In-Reply-To: <1269080605-5617-1-git-send-email-meskio@sindominio.net> References: <873a09jt2t.fsf@yoom.home.cworth.org> <1269080605-5617-1-git-send-email-meskio@sindominio.net> Date: Sun, 21 Mar 2010 21:07:56 +0100 Message-ID: <87sk7te8v7.fsf@SSpaeth.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: [notmuch] reverse iterators 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: Sun, 21 Mar 2010 20:08:02 -0000 On Sat, 20 Mar 2010 11:23:20 +0100, Ruben Pollan wrote: > > Adds support to reverse iteration on messages, threads and tags. To revew and > think if makes sense to include them on notmuch or wait until they have a real > use. /me raises arm. Real use case here! Personally, I don't need the backwards operator (and I don't see the case where I would need to go back very often). But a _move_to_first() for threads, messages (and probably tags), would be really useful to me now: Having bound notmuch.so to python, I am in a situation, where I can only offer iteration once, with subsequent iterations failing. This is very unexpected and very un-pythonesque. I fell myself over it: #the below len() iterates and exhausts msgs if len(msgs) > 0: for msg in msgs: print msg #above line fails horribly already... else: print "No message for me!" So, having a way to reset the iterator would be a real boon already now. Sebastian