while loop with f.readline()

piet at cs.uu.nl piet at cs.uu.nl
Thu Feb 22 09:59:26 EST 2001


>>>>> Sean Reifschneider <jafo-pythonlist at tummy.com> (SR) writes:

SR> On Thu, Feb 15, 2001 at 01:22:39PM +0000, Jeff Epler wrote:
>> I'd say, "xreadlines will never hold more than a few KB of the file
>> in memory", but that's wrong if you have a file with a multi-megabyte line.

SR> Say "xreadlines()" will never hold more than a single line of the file in
SR> memory.  Note the implications if you feed it a file with multi-megabyte
SR> line(s).

If you really want to be smart-assed you should note that that isn't
entirely true: there will probably also be some buffer, which may contain
more than one line. :=(
-- 
Piet van Oostrum <piet at cs.uu.nl>
URL: http://www.cs.uu.nl/~piet [PGP]
Private email: P.van.Oostrum at hccnet.nl



More information about the Python-list mailing list