Re: [Python-Dev] Dropping bytes "support" in json

"Stephen J. Turnbull" <[email protected]>
Newsgroups gmane.comp.python.mime.devel,gmane.comp.python.devel
Message-ID <[email protected]>
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.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.