[Email-SIG] API thoughts
Barry Warsaw
barry at python.org
Wed Mar 2 22:12:06 CET 2011
On Mar 01, 2011, at 08:45 PM, R. David Murray wrote:
>They don't. The issue is that what we would like is for the email6 API
>for the address header to be that it looks like a list of Address objects.
>So msg['To'][0] would yield an address object. But if we also want the
>header to look like a string, that won't work, because as a string that
>should yield the first character of the body of the header.
Here's where things get really interesting because you won't actually know
what msg[header][0] could return for any arbitrary value of 'header'.
For structured headers like To, msg['To'] can return an ordered sequence of
address objects, but what about msg['Received'] or msg['X-Happy-Fun-Ball']?
The same will go for anything like .addresses.
I'm not sure what the implications of this for the API are, but it's important
to keep in mind (I know RDM knows this) that structured headers need extra
parsing and will have more sophisticated objects representing them.
-Barry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/email-sig/attachments/20110302/bfd511a8/attachment.pgp>
More information about the Email-SIG
mailing list