On Jul 27, 2:16 pm, Duncan Booth <[EMAIL PROTECTED]> wrote:
> Alexandre Ferrieux <[EMAIL PROTECTED]> wrote:
> > Now, *why* is such buffering gaining speed over stdio's fgets(), which
> > already does input buffering (though in a more subtle way, which makes
> > it still usable with pipes etc.) ?
>
Alexandre Ferrieux <[EMAIL PROTECTED]> wrote:
> Now, *why* is such buffering gaining speed over stdio's fgets(), which
> already does input buffering (though in a more subtle way, which makes
> it still usable with pipes etc.) ?
>
Because the C runtime library has different constraints than Pyth
Hi,
In a recent thread I discovered why the "for line in f" idiom was not
suitable for live sources (pipes, sockets, tty).
The reason is that it uses buffering on input, blocking on a full
buffer read before anything.
When I asked why it did it this way, the answer came up that it made
it faster.