[Python-Dev] str object going in Py3K
Guido van Rossum
guido at python.org
Thu Feb 16 19:33:19 CET 2006
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.
--
--Guido van Rossum (home page: http://www.python.org/~guido/)
More information about the Python-Dev
mailing list