TOTAL = 100000
import timeit
timeit.timeit('list(my_seq())', setup='from __main__ import my_seq', number
    =1000)
timeit.timeit('list(my_xrange())', setup='from __main__ import my_xrange',
    number=1000)
timeit.timeit('list(my_list())', setup='from __main__ import my_list',
    number=1000)
timeit.timeit('my_list()', setup='from __main__ import my_list', number=1000)
Why is a generator produced by yield faster than a generator produced by xrange?