[Patches] Parsing strings with \r\n or \r

Guido van Rossum guido@python.org
Tue, 30 May 2000 09:41:15 -0500


[Tim]
> > IMO there should be *no* #ifdefs in any of this logic:  regardless of
> > platform, and regardless of program source (be it file, string, file-like
> > object, ...), Python tokenizers should recognize all of \r\n, \n, and \r as
> > terminating a line (with \r\n viewed as a single line terminator when it
> > appears, rather than as \r first and then an empty line ending with \n).
> > Note that Java compilers are required to do this for Java source code, and
> > it's a workaround that actually works.  Somebody else will have to consider
> > the 3,017 other ways Unicde spells end-of-line <0.9 wink>.
> 
> I'm with little Timmy on this one. Just make all platforms deal with all
> newline types.
> 
> And then, yah: make that available to the string-based parsing, too.

+2 here.

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