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

Popular posts from this blog

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -