#!/usr/local/bin/python2 from collections import deque l = deque() for i in xrange(10000): l.extend([1,2,3,4]) l.clear() print l