#!/usr/local/bin/python2 l = iter(range(20)) for i in xrange(500000): next(n for n in l) print next(n for n in l)