On 21Oct2014 16:16, Dan Stromberg <drsali...@gmail.com> wrote:
[...snip...]
This is tremendously inefficient.  It demands a context switch for
every character.

Inefficiency isn't an issue when you generate one byte a second.

Of course, but who's doing one byte per second?  You and I in our
tests, and perhaps some application developers with remarkably
undemanding I/O.  That doesn't really mean we should _recommend_ a
series of os.read(0, 1)'s.

Indeed not. But there is one glaring exception: the shell's read builtin. Because it can be interspersed in a script between other input-consuming commands, it _must_ read no more than one line, and therefore is has to read in increments of 1 character.

Of course, that says nothing about the upstream write() granularity.

I now return y'all to your regularly sheduled nit picking.

Cheers,
Cameron Simpson <c...@zip.com.au>

If it ain't broken, keep playing with it.
--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to