Re: Dropping bytes "support" in json

James Y Knight <[email protected]>
Newsgroups gmane.comp.python.devel,gmane.comp.python.mime.devel
Message-ID <[email protected]>
On Apr 13, 2009, at 10:11 AM, Barry Warsaw wrote:
> The email package does not need a parser for every header, but it  
> should provide a framework that applications (or third party  
> libraries) can use to extend the built-in header parsers.  A bare  
> minimum for functionality requires a Content-Type parser.  I think  
> the email package should also include an address header (Originator,  
> Destination) parser, and a Message-ID header parser.  Possibly others.

Sure, that's fine...

> The default would probably be some unstructured parser for headers  
> like Subject.


But for unknown headers, it's not a useful choice to return a "str"  
object. "str" is just one possible structured data representation for  
a header: there's no correct useful decoding of all headers into str.  
Of course for the "Subject" header, str is the correct result type,  
but that's not a default, that's explicit support for "Subject". You  
can't correctly decode "To" into a str, so what makes you think you  
can decode "X-Gabazaborph" into str?

The only useful and correct representation for unknown (or  
unimplemented) headers is the raw bytes.

James

_______________________________________________
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: http://mail.python.org/mailman/options/python-dev/python-python-dev%40m.gmane.org
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.