Pyhon 2.x or 3.x, which is faster?

Steven D'Aprano steve at pearwood.info
Wed Mar 9 11:07:16 EST 2016


On Wed, 9 Mar 2016 01:03 pm, Dennis Lee Bieber wrote:

> On Wed, 09 Mar 2016 10:28:40 +1100, Steven D'Aprano <steve at pearwood.info>
> declaimed the following:
> 
> 
>>
>>Python will never expand \n to \r\n. But it may translate \r\n to \n.
>>
> Not on input, but it will on output (on Windows)

That surprises me. Perhaps I read the documentation wrongly? Ah yes,
apparently I did -- Python optionally will modify line endings in both
directions, controlled by the user. In Python 3:

https://docs.python.org/3.5/library/functions.html#open


Thanks for the correction.




-- 
Steven




More information about the Python-list mailing list