[Python-Dev] PEP 278 - finished?

Guido van Rossum guido@python.org
Mon, 25 Mar 2002 16:16:02 -0500


> As far as I know I've addressed all outstanding issues in PEP 
> 278, http://python.sourceforge.net/peps/pep-0278.html and in the 
> accompanying patch.

I'm cautiously in favor of this, but a few more things need to be
addressed.

I didn't study the patch too carefully, so I'll ask:  When this is
disabled through the configure flag, is the 'U' mode still recognized?
I think it ought to be allowed then (and mean simply text mode) so
that Python code opening files in universal mode doesn't have to be
prepared for that situation (it can't use the newlines attribute, but
that's rarely needed I expect).

Before we go ahead, I'd like MvL and MAL to have a look at the patch
to see if there would be interactions with their implementation plans
for PEP 262.

I still think that this PEP is a big hack -- but as big hacks go, it
seems to have a pretty good payback.

I'm hoping that eventually the parser (really the lexer) will be able
to open the file in binary mode and recognize all three newline styles
directly.  That would solve the problems with exec, eval, and compile.

Missing:

- docs for the new open mode and file attributes (!!!)

- docs for the --with-universal-newlines flag in README

- the linecache and py_compile modules should use mode 'U' (any others?)

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