2013/2/18 Alex Gaynor <alex.gaynor@gmail.com>
So, iter(file).next() is slow?

Yes, but only with "rU" mode.
My benchmark with yesterday's build:

$ ~/pypy/pypy-c-jit-60005-0f1e91da6cb2-linux64/bin/pypy -m timeit "fp = open('/tmp/large-text-file'); list(fp)"
10 loops, best of 3: 43.5 msec per loop
$ ~/pypy/pypy-c-jit-60005-0f1e91da6cb2-linux64/bin/pypy -m timeit "fp = open('/tmp/large-text-file', 'rU'); list(fp)"
10 loops, best of 3: 638 msec per loop

15 times slower...

--
Amaury Forgeot d'Arc