Re: API for Header objects [was: Dropping bytes "support" in json]

"Stephen J. Turnbull" <[email protected]>
Newsgroups gmane.comp.python.mime.devel
Message-ID <[email protected]>
Tony Nelson writes:

 > Well, msg['To'] would return a list (or tuple) of addresses (which
 > are tuples), so msg['To'][0] would return the first such address,
 > if any.  No converter required.

How do you propose to spell

    msg['To'].split_addresses()[0]

where the split_addresses method returns a list of addresses in their
original form?  And is it really worth losing the consistency that
str(msg[tag]) and bytes(msg[tag]) (especially the latter) do something
more or less useful regardless of whether 'tag' names a structured
field or a text field?

As I wrote elsewhere, I don't *know* that such features will be useful
or practically implementable, but I do think what you're suggesting is
premature and overly restrictive.  Especially since we are pretty sure
(due to the desire for idempotency) that internally msg['To'] will
*not* be a sequence of addresses parsed into display name and mailbox.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.