On Thu, 25 Jun 2009 17:53:51 +0100, I wrote: >On Thu, 25 Jun 2009 10:31:47 -0500, Kirk Strauser ><k...@daycos.com> wrote: > >>At 2009-06-24T19:53:49Z, Angus Rodgers <twir...@bigfoot.com> writes: >> >>> print ''.join(map(detab, f.xreadlines())) >> >>An equivalent in modern Pythons: >> >>>>> print ''.join(line.expandtabs(3) for line in file('h071.txt')) > >I guess the code below would also have worked in 2.1? >(It does in 2.5.4.) > > print ''.join(line.expandtabs(3) for line in \ > file('h071.txt').xreadlines())
Possibly silly question (in for a penny ...): does the new feature, by which a file becomes iterable, operate by some kind of coercion of a file object to a list object, via something like x.readlines()? <runs for cover> -- Angus Rodgers -- http://mail.python.org/mailman/listinfo/python-list