[Python-Dev] [Email-SIG] Dropping bytes "support" in json
Stephen J. Turnbull
stephen at xemacs.org
Fri Apr 10 21:04:22 CEST 2009
Shouldn't this thread move lock stock and .signature to email-sig?
Barry Warsaw writes:
> >> It does seem to make sense to think about headers as text header
> >> names and text header values.
> > I disagree. IMHO, structured header types should have object values,
> > and something like
> While I agree, there's still a need for a higher level API that make
> it easy to do the simple things.
Sure. I'm suggesting that the way to determine whether something is
simple or not is by whether it falls out naturally from correct
structure. Ie, no operations that only a Cirque du Soleil juggler can
perform are allowed.
> I agree that the Message class needs to be strict. A parser needs to
> be lenient;
Not always. The Postel Principle only applies to stuph coming in off
the wire. But we're *also* going to be parsing pseudo-email
components that are being handed to us by applications (eg, the
perennial control-character-in-the-unremovable-address Mailman bug).
Our parser should Just Say No to that crap.
> see the .defects attribute introduced in the current email
> package. Oh, and this reminds me that we still haven't talked about
> idempotency. That's an important principle in the current email
> package, but do we need to give up on that?
"Idempotency"? I'm not sure what that means in the context of the
email package ... multiplication by zero?<wink> Do you mean that
.parse().to_wire() should be idempotent? Yes, I think that's a good
idea, and it shouldn't be too hard to implement by (optionally?)
caching the whole original message or individual components (headers
with all whitespace including folding cached verbatim, etc). I think
caching has to be done, since stuff like "did the original fold with a
leading tab or a leading space, and at what column" and so on seems
kind of pointless to encode as attributes on Header objects.
[Description of MessageTextView and MessageWireView elided.]
> This seems similar to Glyph's basic idea, but with a different spelling.
Yes. I don't much care which way it's done, and Glyph's style of
spelling is more explicit. But I was thinking in terms of the number
of people who are surely going to sing "Mama don' 'low no Unicodes
roun' here" and squeal "codec WTF?! outta mah face, man!"
More information about the Python-Dev