<div class="gmail_quote">On Tue, Jan 10, 2012 at 6:36 PM, MRAB <span dir="ltr"><<a href="mailto:python@mrabarnett.plus.com">python@mrabarnett.plus.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div class="im">On 11/01/2012 01:59, Nick Coghlan wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Tue, Jan 10, 2012 at 8:15 PM, Masklinn<<a href="mailto:masklinn@masklinn.net" target="_blank">masklinn@masklinn.net</a><u></u>><br>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
So the keyword argument means "do or don't call flush() method of<br>
the file."<br>
</blockquote>
That's not clear from its name since the flushing behavior can<br>
depend on the underlying stream type. force_flush would be closer<br>
to the actual meaning of the param.<br>
</blockquote>
<br>
+0 for being able to write print("whatever", force_flush=True)<br>
instead of having to do:<br>
<br>
import sys # somewhere in the file<br>
</blockquote>
> print("whatever")<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
sys.stdout.flush()<br>
<br>
</blockquote></div>
Given that 'print' is a function in Python 3, it's easy to redefine it<br>
to flush. I've done it on occasion.<br></blockquote></div><br>Heh, that's exactly why we made it a function. So is adding e.g. a force_flush flag -- though personally I would be fine calling it "flush" despite the possibility that the underlying stream might still flush when it is not explicitly requests.<br clear="all">

<br>-- <br>--Guido van Rossum (<a href="http://python.org/~guido">python.org/~guido</a>)<br>