On 1/17/2012 5:59 AM, anatoly techtonik wrote:
1. print() buffers output on Python3
2. print() also buffers output on Python2, but only on Linux
No, print() does not buffer output. It merely sends it to a file.
4. print() is not guilty - it is sys.stdout.write() that buffers output
Oh, you already know that 1&2 are false.
So is 4, if interpreted as saying that sys.stdout.write() *will* buffer
output. sys.stdout can be *any* file-like object. Its .write method
*may* buffer output, or it *may not*. With IDLE, it does not. We have
been over this before. At your instigation, the doc has been changed to
make this clearer. At your request, a new feature has been added to
force flushing. By most people's standards, you won.
--
Terry Jan Reedy
_______________________________________________
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