Lazy "for line in f" ?

Alexandre Ferrieux alexandre.ferrieux at
Mon Jul 23 12:37:47 CEST 2007

On Jul 23, 12:18 pm, Duncan Booth < at invalid.invalid>
> Whatever, the iterator makes the code both cleaner and faster. It is at
> the expense of not being suitable for interactive sessions, or in some
> cases pipes, but for those situations you can continue to use readline
> and the extra overhead in runtime will not likely be noticable.

But *why* is it so ? If Python calls fgets() which already has
internal buffering, why is the extra buffering gaining so much ?


More information about the Python-list mailing list