var-8.1-namedtuple-5th.py 224 B

123456789101112
  1. import bench
  2. from ucollections import namedtuple
  3. T = namedtuple("Tup", ["foo1", "foo2", "foo3", "foo4", "num"])
  4. def test(num):
  5. t = T(0, 0, 0, 0, 20000000)
  6. i = 0
  7. while i < t.num:
  8. i += 1
  9. bench.run(test)