[Python-3000] 3K bytes I/O? (original) (raw)

Guido van Rossum guido at python.org
Fri Oct 26 21:26:17 CEST 2007


2007/10/26, Bill Janssen <janssen at parc.com>:

I'm looking at the Py3K SSL code, and have a question:

What's the upshot of the bytes/string decisions in the C world? Is PyString* now all about immutable bytes, and PyUnicode* about strings? There still seem to be a lot of encode/decode methods in stringobject.h, operations which I'd expect to be in unicodeobject.h.

I think the PyString encode/decode APIs should all go; use the corresponding PyUnicode ones.

I recommend that you write your code to assume PyBytes for encoded/binary data, and PyUnicode for text; at some point we'll substitute PyString for most cases where PyBytes is currently used: that will happen once PyString is called bytes in at the Python level, and PyBytes will be called buffer. But that's still a while off.

-- --Guido van Rossum (home page: http://www.python.org/~guido/)



More information about the Python-3000 mailing list