Consider this:
def function1():
def nestedfunc(param1, **kw):
logging.info("nested function %s" % kw) #error
function2(nestedfunc("is called"), string="not default")
def function2(func, string="default"):
try:
#doing some setting
func()
finally:
#reset back to setting
I am getting:
func()
TypeError: 'NoneType' object is not callable
I am assuming the func() is not passing parameters and it causes the error.
To clarify, the desire result is to be able to call func() with any number of parameters added.
Does anyone know what is the proper way to do it? Any advice would be thankful!