Glenn Linderman <v+pyt...@g.nevcal.com> added the comment:

David-Sarah said:
In any case, given that the buffer of the initial std{out,err} will always be a 
BufferedWriter object (since .buffer is readonly), it would be possible for the 
TextIOWriter to test a dirty flag in the BufferedWriter, in order to check 
efficiently whether the buffer needs flushing on each write. I've looked at the 
implementation complexity cost of this, and it doesn't seem too bad.

So if flush checks that bit, maybe TextIOWriter could just call buffer.flush, 
and it would be fast if clean and slow if dirty?  Calling it at the beginning 
of a Text level write, that is, which would let the char-at-a-time calls to 
buffer.write be fast.

And I totally agree with msg132191

----------

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

Reply via email to