In <[EMAIL PROTECTED]>, 7stud wrote: > Anyway, it seems everyone is saying that when you iterate over a file, the > whole file is first read into memory. Therefore iterating over sys.stdin > is consistent: you have to type Ctrl+D to signal EOF before the iteration > can start. Is that about right?
Not the whole file is read but a block of it. If you type in enough to fill the buffer the iteration can start without an EOF on `sys.stdin`. See the second example in <[EMAIL PROTECTED]> which demonstrates that not the whole file is read at once by the iterator. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list