[Email-SIG] API for Header objects [was: Dropping bytes "support" in json]
R. David Murray
rdmurray at bitdance.com
Fri Apr 17 17:21:34 CEST 2009
On Sat, 18 Apr 2009 at 00:13, Stephen J. Turnbull wrote:
> R. David Murray writes:
>
> > put Header objects into it. I don't think the "overhead" of
> > having to do
> >
> > message['Subject'] = Header('subject string')
>
> Hm. Should a Header know which header it is? Ie, should that be
>
> message['Subject'] = Header('subject', 'subject string')
>
> ? (I assume you would be less than in love with having the assignment
> magically stuffing "Subject" into the Header as it gets assigned.)
Hmm. Probably. But:
message.addHeader(Header('subject', 'subject string'))
would seem sensible. That looses the nice collections interface...but
if a Header knows its keyword then it makes sense.
However, I'm not convinced a Header should know its keyword. After all,
the only difference between a From: header and a To: header is the
keyword, and one can easily imagine wanting to do something like:
replymessage['to'] = frommessage['from']
--David
More information about the Email-SIG
mailing list