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

Devin Jeanpierre jeanpierreda at gmail.com
Mon Jan 9 11:53:09 CET 2012


> In Python 2 "print 'something', statement calls were unbuffered and
> immediately appeared on screen.

No, they weren't.

Python doesn't do any extra buffering or flushing. Usually your
terminal emulator line-buffers stdout. If you don't print a newline
(in Python 2 OR 3) then it doesn't show up until you either flush
(sys.stdout.flush()) or send a newline.

-- Devin

On Mon, Jan 9, 2012 at 5:30 AM, anatoly techtonik <techtonik at gmail.com> wrote:
> In Python 2 "print 'something', statement calls were unbuffered and
> immediately appeared on screen.
> In Python 3 "print('something', end='')" calls are buffered. This breaks
> progress bars and other stuff.
>
> 1. What is more "Pythonic" and why?
> 2. Should Python 3 be fixed ASAP?
> --
> anatoly t.
>
> _______________________________________________
> 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