Greg Ewing writes: > 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 if there's more than one line ending used, that's not good enough. Universal newlines is a wonderful convenience for most text usage, but if you really need to be able to preserve format, it's not going to be enough. I think it's best for universal newlines to be simple. Let fancy facilities be provided by a library wrapping raw IO, as you suggest. _______________________________________________ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com