[Python-3000] str/unicode tests: pyexpat.c and read(n)

Fred L. Drake, Jr. fdrake at acm.org
Sun Jul 22 17:56:34 CEST 2007


On Sunday 22 July 2007, Guido van Rossum wrote:
 > Now I'm confused. Are we proposing that all our XML APIs read and
 > write encoded bytes, or are we proposing that they read and write
 > Unicode strings, leaving the encoding/decoding to the I/O stream? I
 > thought the latter was preferred but now it looks like you're arguing
 > for the former?

XML should always be read as bytes, and the output of serialization should be 
bytes (the Py3k "bytes" type, or some immutable flavor of the same).

The APIs that present data parsed from XML, and that accept input that should 
be serialized in XML, should use Unicode strings (the Py3k "str" type).


  -Fred

-- 
Fred L. Drake, Jr.   <fdrake at acm.org>


More information about the Python-3000 mailing list