#!/usr/local/bin/python2 from collections import deque e = [1,2,3,4] for i in xrange(100000): l = range(10) for j in xrange(10): l.pop(0) l[:] = e print l