[Python-3000] Universal newlines support in Python 3.0
Greg Ewing
greg.ewing at canterbury.ac.nz
Sat Aug 11 04:03:39 CEST 2007
Guido van Rossum wrote:
> However, the old universal newlines feature also set an attibute named
> 'newlines' on the file object to a tuple of up to three elements
> giving the actual line endings that were observed on the file so far
> (\r, \n, or \r\n).
I've never used it, but I can see how it could be
useful, e.g. if you're implementing a text editor
that wants to be able to save the file back in
the same format it had before.
But such a specialised use could just as well be
provided by a library facility, such as a wrapper
class around a raw I/O stream.
--
Greg
More information about the Python-3000
mailing list