Just use functools.partial
multiplyNumbers = functools.partial(multiplyNumbers, y = 42)
One problem here: you will not be able to call it as multiplyNumbers(5, 7, 9);
you should manually say y=7
If you need to remove default arguments I see two ways:
-
Store original function somewhere
oldF = f f = functools.partial(f, y = 42) //work with changed f f = oldF //restore
-
use
partial.func
f = f.func //go to previous version.