In MATLAB it is possible to create function handles with something like
myfun=@(arglist)body
This way you can create functions on the go withou
Turns out there is something that goes all the way back to 2.5 called function partials that are pretty much the exact analogy to function handles.
from functools import partial
def myfun(*args, first="first default", second="second default", third="third default"):
for arg in args:
print(arg)
print("first: " + str(first))
print("second: " + str(second))
print("third: " + str(third))
mypart = partial(myfun, 1, 2, 3, first="partial first")
mypart(4, 5, second="new second")
1
2
3
4
5
first: partial first
second: new second
third: third default