[Python-ideas] Pythonic buffering in Py3 print() (original) (raw)

Nick Coghlan ncoghlan at gmail.com
Wed Jan 11 02:59:02 CET 2012


On Tue, Jan 10, 2012 at 8:15 PM, Masklinn <masklinn at masklinn.net> wrote:

So the keyword argument means "do or don't call flush() method of the file." That's not clear from its name since the flushing behavior can depend on the underlying stream type. forceflush would be closer to the actual meaning of the param.

+0 for being able to write print("whatever", force_flush=True) instead of having to do:

import sys # somewhere in the file print("whatever") sys.stdout.flush()

Cheers, Nick.

-- Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia



More information about the Python-ideas mailing list