[Python-Dev] Dropping bytes "support" in json
Stephen J. Turnbull
stephen at xemacs.org
Tue Apr 14 09:00:59 CEST 2009
Warning: Reply-To set to email-sig.
Greg Ewing writes:
> Only for headers known to be unstructured, I think.
> Completely unknown headers should be available only
> as bytes.
Why do I get the feeling that you guys are feeling up an
elephant?<wink>
There are four things you might want to do with a header:
(1) Put it on the wire, which must be bytes (in fact, ASCII).
(2) Show it to a user (such as a rootin-tootin spam-fightin mail
admin), which for consistency with well-behaved, implemented
headers (ie, you might want to *gasp* *concatenate* your unknown
header with a string), will sooner or later be string (ie,
Unicode).
(3) (Try to) parse it, in which case an internal representation with
some other structure may or may not be appropriate for storing the
parsed data.
(4) Munge it, in which case an internal representation with some other
structure may or may not be appropriate.
I see no particular reason for restricting these basic API classes for
any header.
More information about the Python-Dev
mailing list