You probably know the answer to my question. PEP 234 says that these are equivalent:
for line in iter(f.readline, ""):
...
for line in f:
...
But they are not. When reading from a named pipe, the first will work after a newline has been sent to the pipe and then the pipe has been flushed, while the latter only outputs after a large number of bytes have been put into the pipe. Why? Some kind of buffering with the internal next function?
Comment
You probably know the answer to my question. PEP 234 says that these are equivalent:
for line in iter(f.readline, ""):
...
for line in f:
...
But they are not. When reading from a named pipe, the first will work after a newline has been sent to the pipe and then the pipe has been flushed, while the latter only outputs after a large number of bytes have been put into the pipe. Why? Some kind of buffering with the internal next function?
http://ubuntuforums.org/showthread.php?t=916518