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

Matt Joiner anacrolix at gmail.com
Tue Jan 10 10:15:27 CET 2012


I don't think it would be straight forward or reasonable to _prevent_
flushing from occurring. Forcing a flush, is only useful when the file
object to which you're printing isn't already handy, and this only
occurs for sys.stdout. It's not worth adding a "flush-in-case" flag
just for this one stream, especially if it's unable to prevent
flushing.

On Tue, Jan 10, 2012 at 8:05 PM, INADA Naoki <songofacandy at gmail.com> wrote:
> On Tue, Jan 10, 2012 at 5:49 PM, Carl M. Johnson
> <cmjohnson.mailinglist at gmail.com> wrote:
>>
>> On Jan 9, 2012, at 7:52 PM, INADA Naoki wrote:
>>
>>> What about adding flush=False keyword argument to print()?
>>
>> I would expect flush=False to mean "please don't flush this right now, even if I do use a newline."
>
> print() doesn't flushes even if there is newline. So the keyword argument means
> "do or don't call flush() method of the file."
>
>>
>> flush=None?
>> _______________________________________________
>> Python-ideas mailing list
>> Python-ideas at python.org
>> http://mail.python.org/mailman/listinfo/python-ideas
>
>
>
> --
> INADA Naoki  <songofacandy at gmail.com>
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> http://mail.python.org/mailman/listinfo/python-ideas



More information about the Python-ideas mailing list