The question is pretty much self contained. I have a function with some default parameters, for example
def f(x=None):
# some code...
defined in a module. I want to be able to import this function in a script and depending an some values computed in this script modify the default values to have effectively:
def f(x=0):
# same code as before
How can I do that? (I know they are plenty of ways to do almost the same thing like defining a new function based on f
, but I really want to modify f
itself if possible.)