From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id C1BC56DE2C88 for ; Mon, 26 Jun 2017 16:19:51 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.001 X-Spam-Level: X-Spam-Status: No, score=-0.001 tagged_above=-999 required=5 tests=[AWL=0.010, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hfATYQV5AyS0 for ; Mon, 26 Jun 2017 16:19:50 -0700 (PDT) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by arlo.cworth.org (Postfix) with ESMTPS id 3265E6DE2C75 for ; Mon, 26 Jun 2017 16:19:49 -0700 (PDT) Received: from remotemail by fethera.tethera.net with local (Exim 4.84_2) (envelope-from ) id 1dPdFF-0002mi-Gf; Mon, 26 Jun 2017 19:16:37 -0400 Received: (nullmailer pid 21711 invoked by uid 1000); Mon, 26 Jun 2017 23:19:47 -0000 From: David Bremner To: Lucas Hoffmann , notmuch@notmuchmail.org Subject: Re: [PATCH 1/2] python: add bindings for notmuch_database_get_config{, _list} In-Reply-To: <149798918666.30630.17090980439386410942@localhost.localdomain> References: <7cb0da4d17891d1284b14dbdbe116c65dfaf0195.1496596853.git.l-m-h@web.de> <87zidgcd4a.fsf@tethera.net> <149798918666.30630.17090980439386410942@localhost.localdomain> Date: Mon, 26 Jun 2017 20:19:47 -0300 Message-ID: <8737am9w18.fsf@tethera.net> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.23 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: Mon, 26 Jun 2017 23:19:51 -0000 Lucas Hoffmann writes: > > I don't see a reason to have python programmers handle "manual > iterators" or however you want to call the thing the C code does there. > So I would like to keep *some* simplified interface as well. > > It is very easy to turn this into a generator. But then I consider the > name a mismatch. If it is called "get_config_list" it should return a > list. I could add get_config_iterator or get_config_generator and turn > get_config_list into a wrapper: For starters I'd just create get_config_{iterator,generator}, which ever is a more pythonic name. As you point out below, it's easy to turn that into a list or a dictionary. > > The only problem one could see with this additional entry point is what > you said in id:87wp8kcbvg.fsf@tethera.net about the function > get_all_named_queries (quote below), namely that the names of the python > bindings diverge from the names of the C bindings. It's not so much the names diverging that I worry about as the functionality. The C library provides (effectively) a generator, so the bindings should too. d