Some time ago I looked over Haskell docs and found it\'s functional composition operator really nice. So I\'ve implemented this tiny decorator:
from functools im
You can do it with reduce, although the order of calls is left-to-right only:
reduce
def f1(a): return a+1 def f2(a): return a+10 def f3(a): return a+100 def call(a,f): return f(a) reduce(call, (f1, f2, f3), 5) # 5 -> f1 -> f2 -> f3 -> 116 reduce(call, ((lambda x: x+3), abs), 2) # 5