I have various functions with a mix of positional and watchword contentions, and I might want to tie one of their arguments to a given worth (which is known simply after the function definition). Is there an overall method of doing that?
Look at my first try:
def f(a,b,c): print a,b,c
def _bind(f, a): return lambda b,c: f(a,b,c)
bound_f = bind(f, 1)
Nonetheless, for this, I need to realize the specific args passed to f, and can't utilize a single function to bind all the capacities I'm keen on (since they have a distinctive argument lists).