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

M.-A. Lemburg mal at egenix.com
Wed Aug 18 22:10:32 CEST 2004


Martin v. Löwis wrote:
> M.-A. Lemburg wrote:
> 
>> Indeed... and the same is true for almost all other methods
>> (except maybe .replace()).
>>
>> Sounds like a lot of code will break.
> 
> 
> We will see. The default string type will be Unicode, so code
> using .lower will continue to work in many cases.
> 
> The question is what open(path,"r").read() will return. It seems
> that Guido wants users to specify "rb" if they want that to be
> byte strings.

This would imply that we'd need to add an encoding parameter
that becomes a required parameter in case 'r' (without 'b')
is specified as mode.

Perhaps we should drop 'b' altogether and make encoding
a required parameter. We could have a 'binary' codec which
then passes through the data as is (as buffer object instead
of as Unicode object for most other codecs).

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, Aug 18 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