[Python-Dev] Re: adding a bytes sequence type to Python

M.-A. Lemburg mal at egenix.com
Mon Aug 23 23:56:37 CEST 2004


Guido van Rossum wrote:
>>Ok, so I suppose that we can learn from Jython and IronPython in
>>this respect...
>>
>>How do they handle binary data and the interfacing between various
>>I/O facilities, e.g. files, sockets, pipes, user input, etc.
> 
> 
> I'm not sure, but I expect that in most cases they use Unicode strings
> in order to be compatibly with Python's standard library.  That's not
> the outcome I'd like to see though.  I believe Jython at least also
> has a bytes-like type (probably a thin wrapper around Java's byte
> array) that's used for interfacing to java classes.

I've had a discussion with Jack Janssen about using bytes as
default return value for I/O operations where no encoding is
specified (or unknown).

He raised the issue of bytes not being usable as dictionary
keys due to their mutability. He was also concerned about the
increase in complexity when writing programs that work with
non-text data or mixed text/data I/O.

If we want to make the move from Python 2.x to 3.0 feasable
for large code bases, then we have to do something about these
issues. It seems that the simple solution of going with Unicode
+ bytes type is not going to be a suitable approach.

Anyway, we still have 4-5 years to think about this :-)

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, Aug 23 2004)
 >>> Python/Zope Consulting and Support ...        http://www.egenix.com/
 >>> mxODBC.Zope.Database.Adapter ...             http://zope.egenix.com/
 >>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
________________________________________________________________________

::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! ::::


More information about the Python-Dev mailing list