[Python-3000] New io system and binary data

Guido van Rossum guido at python.org
Tue Sep 25 19:10:31 CEST 2007


On 9/25/07, Uche Ogbuji <uche at ogbuji.net> wrote:
> Bill Janssen wrote:
> > That's certainly the prescribed behavior for the C stdio streams on
> > POSIX-compliant systems.  I think a lot of the original design of the
> > Python I/O system was based on that C stdio system, including names
> > like stdin, stdout, and stderr.
> >
> > Now that we've moved away from the C stdio model, and the distinction
> > between text and binary streams is meaningful even on POSIX systems,
> > perhaps we should also change those names to reflect that difference
> > from C.  Given that Py3K is a once-in-a-decade chance to break
> > backwards compatibility, and all.  Perhaps something like
> > sys.io.input, sys.io.output, sys.io.err, or something similar.
> >
>
> +1, except I'd say "sys.io.error"for the latter.

-1. I could just say "the deadline for PEPs was last April" or "let's
stop bikeshedding", but I'd rather explain why I would have been
against this idea even if it was proposed with a proper PEP before the
deadline. Maybe it helps stem similar proposals.

In general the goal for Python 3000 is to change only things that are
genuine language warts (things that would remain stumbling blocks
forever if not fixed), and to leave everything else alone as much as
possible. I don't think the naming of sys.stdin and friends in Python
has ever confused anybody, regardless of whether they were amongst the
authors of the C standard library, or had never seen a line of C in
their life.

There are literally thousands of names in the standard library that
could be changed to conform to a better naming scheme, to be more
intuitive, to divorce them from an irrelevant legacy, or for whatever
other reason. Doing so would just cause endless annoyance for people
used to Python 2.x, at no real benefit for future users.

Python 3000 is boldly choosing to be backwards compatible, except in
cases where a real benefit can be obtained by being incompatible. This
is not such a case.

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


More information about the Python-3000 mailing list