Python Success Stories or Nightmares
Alexander Schmolck
a.schmolck at gmx.net
Sun Feb 2 20:58:16 EST 2003
Grzegorz Adam Hankiewicz <gradha at terra.es> writes:
> On Sat, Feb 01, 2003 at 03:38:58PM -0000, James Kew wrote:
> > > while (line = file.readline()):
> > >
> > > I still miss that one-liner.
[...]
> It's incredible how many people jump in to point out that it's
> possible to rewrite that (no, sorry, file.readlines() might need
> more than your available RAM and is not the same), when I just tried
> to say that I miss assigning and testing with one statement.
Well, given that there simply *is* no reason to "miss that one-liner" you
mention above -- as it would just provide an idiotic way to write:
for line in file:... # doesn't need more RAM BTW
-- what did you expect?
alex
More information about the Python-list
mailing list