Peter Otten wrote:
> A quick look into fileinput.py reveals that it uses readlines() and slurps
> in the complete "file". I'm not sure that was a clever design decision...
Correction:
>>> with open("tmp.txt") as f: lines = f.readlines(0)
...
>>> len(lines)
1000000
>>> with open("tmp.txt") as f: lines = f.readlines(1)
...
>>> len(lines)
301
>>> len("".join(lines))
8208
So on my system file.readlines(size) stops after about 2**13 bytes which is
not a problem memorywise. Sorry for the confusion.
--
http://mail.python.org/mailman/listinfo/python-list