On Aug 14, 2007, at 9:56 PM, Guido van Rossum wrote: > I thought some more about the universal newlines situation, and I > think I can handle all the use cases with a single 'newline' > parameter. The use cases are: > > (A) input use cases: > > (1) newline=None: input with default universal newlines mode; lines > may end in \r, \n, or \r\n, and these are translated to \n. > > (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. > > (B) output use cases: > > (1) newline=None: every \n written is translated to os.linesep. > > (2) newline='': no translation takes place. > > (3) newline='\r', newline='\n', newline='\r\n': every \n written is > translated to the value of newline. >
These make a lot of sense to me. I'm working on test cases / cleanup, but I have a patch that implements the behavior above. And the newlines attribute. Thanks -Tony _______________________________________________ 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
