[PATCH] python: add bindings for notmuch_message_get_propert(y/ies)
Daniel Kahn Gillmor
dkg at fifthhorseman.net
Tue Nov 28 17:57:24 PST 2017
On Tue 2017-11-28 23:46:11 +0100, Ruben Pollan wrote:
> Message.get_property (prop) returns a string with the value of the property and
> Message.get_properties (prop, exact=False) returns a list [(key, value)]
This looks like a sensible approach to me. I'd be curious to hear what
others think of this.
In considering the API design space here, it occurs to me that it might
be more pythonic for get_properties to return a dict like:
{ key: [ value, … ], key: [ value, … ] }
Any reason you chose one over the other? My python-fu is shallow, so
please don't take my aesthetic guesswork as authoritative; but i'm
imagining a user wanting to grab a bunch of properties and then easily
access them by key, and the dict seems like the simple way to do that.
Also, does get_properties() work with prop=None to fetch all properties?
if so, maybe that should be the default?
To be clear, I'd be fine with a response that disagrees with these
suggestions (especially if it explains why) and then adopting this
patch; i just want to make sure they've been considered before we lock
in the API.
Thanks for working on this, Meskio!
--dkg
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20171128/c527a6ba/attachment.sig>
More information about the notmuch
mailing list