python - Apply a series of functions to some arguments -
i'm after little more elegant this.
what elegant way implement f such that:
f(a,b,c,d,e)
-> lambda args: a(b(c(d(e(*args)))))
you want reduce
: maybe like:
reduce(lambda x, y: y(x), [a, b, c, d, e], initial_value)
Comments
Post a Comment