How can I modify the local namespace of a function in python? I know that locals() returns the local namespace of the function when called inside it, but I want to do somet
Why don't you just add an argument to f() and pass a reference to g()?
f()
g()
def g(): pass def f(func): func() f(g)