Nick Coghlan wrote: >> Py> print islice((x for x in xrange(1, 996) if x % 2 == 0), 1, 2).next() >> 4 > > Wouldn't it be nice if this could be spelt: > > print (x for x in xrange(1, 996) if x % 2 == 0)[2] > > Well, I just put a patch on SF to enable exactly that: > http://www.python.org/sf/1108272 I like it. Of course you always have to bear in mind that one giant leap for a list could be _many_ small steps for an iterator.
Peter -- http://mail.python.org/mailman/listinfo/python-list