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

Thank you Roger.  Good to hear from you.  

https://stackoverflow.com/questions/66286367/why-is-my-function-faster-than-pythons-print-function-in-idle,
 Feb 2021, was about this issue.  In my answer I verified the claim and then 
showed in further experiments that batching prints solved the issue.  #43283 
added a paragraph to the IDLE doc explaining the problem and suggesting that 
users could work around it by batching and joining before printing.  Buffering 
the streams to do so is an appealing alternative.  I intended to make sure that 
exceptions are completely and not just partly joined and sent in one write.

Some immediate questions:

Can buffering the output streams have any negative consequences.  Does it 
affect isatty, for instance, or anything checking line buffering?  

In case a user is interactively developing a tkinter GUI, IDLE already runs 
tcl.update() in a 50 ms after loop.  Could this be used to trigger writes, by 
calling flush()?

Did you consider using io.TextIOWrapper instead the current TextIOBase as base 
class for the output classes?

I am guessing that you do not have a python/cpython clone for making PRs.  
Tomorrow, I will try to find out how to make apply a .patch file to mine and do 
so.

----------
versions: +Python 3.11 -Python 3.10

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

Reply via email to