Nick Coghlan wrote: >> How's this: >> >> Py> from itertools import islice >> 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]
as I've always said, the sooner we can all use the itertools goodies without even noticing, the better. </F> -- http://mail.python.org/mailman/listinfo/python-list