Get parent function of closure

Viewed 198
def foo():
    def bar():
        pass

    return bar

inner_func = foo()

Is that somehow possible to get reference to parent function foo from inner_func or bar?

Looking into source code of PythonTutorOnline I found what I need here. Is there any other approach to do that so? if not how I can get current stack info without using Bdb?

2 Answers
Related