Re: fixing the current email module
Barry Warsaw <[email protected]> Thu, 8 Oct 2009 08:28:04 -0400
| Newsgroups | gmane.comp.python.mime.devel |
|---|---|
| Message-ID | <[email protected]> |
On Oct 8, 2009, at 3:16 AM, R. David Murray wrote: > I'd like to try to summarize what I understand Barry to be saying > (which, > in this case, also reflects my understanding of what is needed), and > see if I'm anywhere close to on target :) Spot on, IMO! I can only quibble about one thing, though I think it's just in the phrasing of what you wrote (or the way I read it), not in your understanding. > An important property of the API is that both the parser that > transforms > an input stream into a Message and Message serialization should not > raise > exceptions except in the face of errors that leave no way to produce a > valid Message or serialization. I'd say it differently, since we all know you can encounter errors leaving invalid Messages. The parser and generator should only raise exceptions when its basic assumptions (embodied as assertions probably) of the internal model are broken. In almost all cases, I think those would be "bugs" :). It may be in fact that the best you can do is produce a Message object with no headers and a big massive body containing everything else, and a huge defects list. -Barry
PGP.sig
(application/pgp-signature, 832 B) - not displayed