On Tue, Oct 21, 2014, at 19:16, Dan Stromberg wrote:
> Actually, doesn't line buffering sometimes exist inside an OS kernel?
> stty/termios/termio/sgtty relate here, for *ix examples.  Supporting
> code: http://stromberg.dnsalias.org/~strombrg/ttype/  It turns on
> character-at-a-time I/O in the tty driver via a variety of methods for
> portability.  I wrote it in C before I took an interest in Python.

Yes, and 90% of the time, when someone says they want to "flush stdin",
what they really want to do is go to the next line after they've
sloppily read part of the line they're on (and the behavior they are
seeing that they object to is that their next read function reads the
rest of the current line). The appropriate course of action in these
cases is to actually read to the next newline and discard the data, not
to do any kind of flush.
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to