perl to python

Scott Schwartz "schwartz+ at usenet " at bio.cse.psu.edu
Fri May 14 17:13:42 EDT 2004


"Andrew Dalke" <adalke at mindspring.com> writes:
> > 2) Python generators on stdin behave strangely.  For one thing,
> > they're not properly line buffered, so you don't get any lines until
> > eof.  But then, eof is handled wrongly, and the loop doesn't exit.
> 
> There's a command-line flag to make stdin/stdout be unbuffered.
> Try your test again with 'python -u'.

No effect, because that's not the problem.  The generator is reading
ahead and doing it's own buffering, in addition to whatever the stream
is doing (or not doing).  Hence the bug.



More information about the Python-list mailing list