#!/usr/local/bin/python2 from collections import deque for i in xrange(100000): l = range(20) d = deque(l) d.popleft() print d