Bengt Richter wrote: > On 6 Dec 2005 07:41:45 -0800, [EMAIL PROTECTED] wrote: > > > >If one really wants a very messy one-liner, it is possible > > > >import operator > >x=3D[2] > >lst=3Dlist(((operator.setitem(x,0,x[0]**2),x[0])[1] for _ in > >xrange(10000000) if x[0] < 1000 or iter([]).next())) > > > Or > >>> list(iter(lambda b=[2]:b.append(b[0]**2) or b[0]<1000 and b.pop(0) or > None, None)) > [2, 4, 16, 256] > out of curiosity, what stops the iterator ?
-- http://mail.python.org/mailman/listinfo/python-list