Terry J. Reedy <tjre...@udel.edu> added the comment:

Python 3.2, WinXP, IDLE edit window, F5 Run:
'Processing ...' appears immediately, 'Done' 3 sec later.
The only difference between printtest2/3 is where 'Done' appears.

Behavior is same when pasting into interactive interpreter -- has to be since 
the first two prints are executed before the sleep. I presume interpreter 
flushes before or after printing next prompt. IDLE must do same even when 
running from editor even when not printing prompts.

Anatoly, I gather you ran files by some other method.

I disagree with closing this yet. Print was designed to be a simplified wrapper 
around sys.stdout.write (and now, any file.write). Requiring that one import 
sys to use print goes against that.

I have always experienced and expected Python's print to screen to be 
immediately visible. I thought that was pretty standard in other languages with 
a print-to-screen separate from general file-write. When printing to screen, 
efficiency is, I believe, a non-issue. Writing to files or the net is a whole 
different ballgame.

Amaury's idea of checking isatty seems good. Otherwise, print should gain an 
optional, no-default flush=True/False parameter (no default because behavior 
currently varies.) Until then, non-flushing *should* be documented. The current 
doc for print does not seem to address the issue either way.

Amaury, I though 'run from console' more or less meant 'isatty', so I am not 
sure I understand your comment.

----------
assignee:  -> docs@python
components: +Documentation, Library (Lib)
nosy: +docs@python, terry.reedy
resolution: invalid -> 
status: closed -> open
type:  -> feature request
versions: +Python 3.3

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue11633>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to