Author v+python
Recipients David.Sankel, amaury.forgeotdarc, christian.heimes, christoph, davidsarah, ezio.melotti, hippietrail, lemburg, mark, pitrou, santoso.wijaya, ssbarnea, terry.reedy, tim.golden, tzot, v+python, vstinner
Date 2011-03-26.01:45:11
SpamBayes Score 4.26893e-07
Marked as misclassified No
Message-id <>
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
Date User Action Args
2011-03-26 01:45:12v+pythonsetrecipients: + v+python, lemburg, terry.reedy, tzot, amaury.forgeotdarc, pitrou, vstinner, christian.heimes, tim.golden, mark, christoph, ezio.melotti, hippietrail, ssbarnea, davidsarah, santoso.wijaya, David.Sankel
2011-03-26 01:45:12v+pythonsetmessageid: <>
2011-03-26 01:45:12v+pythonlinkissue1602 messages
2011-03-26 01:45:11v+pythoncreate