#!/usr/local/bin/python2 from functools import partial def a(x): return x + 2 def b(x): return x * 3 def c(x): return x - 4 t = (a, b, c) m = lambda x, y: y(x) p = partial(reduce, m, t) for i in xrange(700000): #reduce(lambda x, y: y(x), t, 1) p(1) print p(1)