[Python-3000] Proposed new language for newline parameter to TextIOBase
Barry Warsaw
barry at python.org
Wed Aug 15 18:11:18 CEST 2007
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Aug 15, 2007, at 9:28 AM, Christian Heimes wrote:
> 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*
Yes, excellent idea.
- -Barry
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)
iQCVAwUBRsMlpnEjvBPtnXfVAQINBAP/en1BYxU9wKErov26dyqo8snJLNnregEO
YVP/8b9EM4csEMAJbO/pOBjsOuub/TO5h7nCdiuV0GAGTAzzt4kICHr/cEVGKnOU
dCd949uTLeIYVkgJnPnJ/ynE5Q30uMIIysXBbrbNx3rWJt74fNBDuF0xLHgw4d0O
cHvT5rzmdvs=
=DwhF
-----END PGP SIGNATURE-----
More information about the Python-3000
mailing list