[Python-Dev] xreadlines : readlines :: xrange : range

Paul Prescod paulp@ActiveState.com
Tue, 02 Jan 2001 14:59:47 -0800

Skip Montanaro wrote:
>     Guido> I'm slowly warming up to xreadlines(), ...
> I haven't followed this thread closely, and my brain is a bit frazzled at
> the moment, but is there some fundamental reason that the file object's
> readlines method can't be made lazy, perhaps only when given a sizehint?

I suggested this at one point but it was pointed out that there is
probably a lot of code that works with the resulting list *as a list*
i.e. as a random-access, writable sequence object. I really wasn't
thrilled with xreadlines at first either...it's the least of all
possible evils (including the status quo).