On 9/8/07, Marcin 'Qrczak' Kowalczyk <[EMAIL PROTECTED]> wrote:
> Dnia 14-08-2007, Wt o godzinie 21:56 -0700, Guido van Rossum napisaƂ(a):
>
> > (2) newline='': input with untranslated universal newlines mode; lines
> > may end in \r, \n, or \r\n, and these are returned untranslated.
> >
> > (3) newline='\r', newline='\n', newline='\r\n': input lines must end
> > with the given character(s), and these are translated to \n.
>
> What is the difference between '' and '\n'?

None on output.

On input, "\n" disables universal newline mode altogether ("\r"
doesn't end a line), while "" enables universal newlines for
determining the line ending, but disables the *translation* part,
meaning you will get lines ending in "\r", "\r\n", or "\n" depending
on what's in the input. The default UN mode with translation is easier
for most apps (since it guarantees that lines end in \n like most apps
expect), but the UN mode without translation is handy if you want to
copy the file faithfully (apart from specific edits).

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)
_______________________________________________
Python-3000 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to