from functools import reduce
def compose(f1, f2):

    def composition(*args, **kwargs):
        return f1(f2(*args, **kwargs))
return composition

def compose_many(*funcs):
    return reduce(compose, funcs)
Python avoiding lambda for key which needs two callables (function composition)