The higher-order function functools.partial()
can create a new function as follows:
newf(arg1) = functools.partial( f, arg1, val )
which is obviously equivalent to just saying
def newf(arg1): return f( arg1, val )
in terms of what they do. But what about performance? Does functools.partial()
actually create a new function that does not need to call f
or are they identical?