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 12CB26DE0FB6 for ; Sat, 10 Jun 2017 04:37:11 -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 8pGMvZpXmUzD for ; Sat, 10 Jun 2017 04:37:10 -0700 (PDT) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by arlo.cworth.org (Postfix) with ESMTPS id 5C5FD6DE0C7A for ; Sat, 10 Jun 2017 04:37:10 -0700 (PDT) Received: from remotemail by fethera.tethera.net with local (Exim 4.84_2) (envelope-from ) id 1dJegb-0008Id-8S; Sat, 10 Jun 2017 07:36:09 -0400 Received: (nullmailer pid 20876 invoked by uid 1000); Sat, 10 Jun 2017 11:37:07 -0000 From: David Bremner To: l-m-h@web.de, notmuch@notmuchmail.org Cc: Lucas Hoffmann Subject: Re: [PATCH 2/2] python: add convenience function to get named queries In-Reply-To: <34d9febc53775a24ca9e1bb1abcef64ea9196b12.1496596853.git.l-m-h@web.de> References: <7cb0da4d17891d1284b14dbdbe116c65dfaf0195.1496596853.git.l-m-h@web.de> <34d9febc53775a24ca9e1bb1abcef64ea9196b12.1496596853.git.l-m-h@web.de> Date: Sat, 10 Jun 2017 08:37:07 -0300 Message-ID: <87wp8kcbvg.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: Sat, 10 Jun 2017 11:37:11 -0000 l-m-h@web.de writes: see above re: commit messages. > --- > bindings/python/notmuch/database.py | 7 +++++++ > 1 file changed, 7 insertions(+) > > + > + def get_all_named_queries(self): > + """Returns a dict of all named queries mapped to their search queries. > + > + This function is a python extension and not in the underlying C API. > + """ > + return {k[6:]: v for k, v in self.get_config_list('query.')} I have somewhat mixed feelings about this. I don't really like the python bindings diverging from the C library. It's also not clear it's worth supporting a new API entry (since e.g. if this goes in it also needs a test) to save the python client one line of code. On the positive side I can see there is arguably a missing abstraction on the library side, as those particular config items are special.