#!/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) p = partial(reduce, lambda x, y: y(x), t) for i in xrange(100000): reduce(lambda x, y: y(x), t, 1) print p(1)