[Python-ideas] iter() on steroids

Jason Orendorff jason.orendorff at gmail.com
Fri Apr 13 16:54:37 CEST 2007

On 4/13/07, George Sakkis <george.sakkis at gmail.com> wrote:
> f1,f2 = [iter(open(f)).map(str.rstrip) for f in 'foo.txt','bar.txt']
> for i,line in (f1[:3] + f2[1:5]).filter(None).enumerate():
>         print i,line

George, you've got to pick a better example next time.  This one
is terrifying.  :)


More information about the Python-ideas mailing list