On Tue, Mar 22, 2011 at 9:57 PM, anatoly techtonik <techto...@gmail.com> wrote: > For example, now I need to remember that on Windows I need to flush > output every time when I want the result of print() with end!='\n' to > appear on the screen immediately. And for the most of my legacy > scripts I used end='\n' when I want to output some progress to user. I > am surprised to know this never worked on Linux, but what I really > didn't expect is to see that choice is made not in user's favor, but > in a favor of speed. This way we'll be writing in a cross-platform > assembly language named 'Python' soon. =)
Python 3 actually chose *cross-platform consistency* over user convenience when switching away from the platform IO implementations. That means things like line buffering of stdout is now the default on all platforms, including Windows, and there is now a meaningful distinction between files opened in binary mode (returning bytes) and files opened in text mode (returning strings) on all platforms, rather than *just* on Windows (where the "b" mode flag was historically always needed to avoid corrupting binary files that happened to contain CRLF sequences). There are several ways to get unbuffered IO back in a cross-platform manner, but efficient codec operation means working that way by default would be a really bad idea. Users may *say* they prefer convenience over speed, but that's only true until the lack of speed becomes intolerably slow. Cheers, Nick. -- Nick Coghlan | ncogh...@gmail.com | Brisbane, Australia _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com