[Python-Dev] str object going in Py3K

M.-A. Lemburg mal at egenix.com
Thu Feb 16 21:50:10 CET 2006


Guido van Rossum wrote:
> On 2/15/06, Alex Martelli <aleaxit at gmail.com> wrote:
>> I agree, or, MAL's idea of bytes.open() and unicode.open() is also
>> good.
> 
> No, the bytes and text data types shouldn't have to be tied to the I/O
> system. (The latter tends to evolve at a much faster rate so should be
> isolated.)
> 
>> My fondest dream is that we do NOT have an 'open' builtin
>> which has proven to be very error-prone when used in Windows by
>> newbies (as evidenced by beginner errors as seen on c.l.py, the
>> python-help lists, and other venues) -- defaulting 'open' to text is
>> errorprone, defaulting it to binary doesn't seem the greatest idea
>> either, principle "when in doubt, resist the temptation to guess"
>> strongly suggests not having 'open' as a built-in at all.
> 
> Bill Janssen has expressed this sentiment too. But this is because
> open() *appears* to work for both types to Unix programmers. If open()
> is *only* usable for text data, even Unix programmers will be using
> openbytes() from the start.

All the variations aside:

What will be the explicit way to open a file in bytes mode
and in text mode (I for one would like to move away from
open() completely as well) ?

Will we have a single file type with two different modes
or two different types ?

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, Feb 16 2006)
>>> 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