#!/usr/local/bin/python2 from collestions import OrderedDict class C(object): name = 0 l = [C(), C(), C(), C(), C(), C(), C(), C(), C(), C()] for i in xrange(10000): m = OrderedDict((j.name, j) for j in l) n = m.keys() c = m.values() print m, n, c