Last Updated: February 25, 2016
·
783
· dawehner

Higher order function in python

Often you want to create a function which returns a function, for example to bind a parameter onto a more generic function.

def create_function_foo(a, b, c)
    def helper_function(x):
        return a*x**2 + b*x + c

    return helper_function