Brett Cannon wrote: > I like the options, but I would swap the meaning of None and the empty > string. My reasoning for this is that for option 3 it says to me > "here is a string representing EOL, and make it \n". So I would think > of the empty string as, "I don't know what EOL is, but I want it > translated to \n". Then None means, "I don't want any translation > done" by the fact that the argument is not a string. In other words, > the existence of a string argument means you want EOL translated to > \n, and the specific value of 'newline' specifying how to determine > what EOL is.
I like to propose some constants which should be used instead of the strings: MAC = '\r' UNIX = '\n' WINDOWS = '\r\n' UNIVERSAL = '' NOTRANSLATE = None I think that open(filename, newline=io.UNIVERSAL) or open(filename, newline=io.WINDOWS) is much more readable than open(filename, newline=''). Besides I always forget if Windows is '\r\n' or '\n\r'. *g* Christian _______________________________________________ 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
