Python how to get the calling function (not just its name)?
Calling can happen from any code object (and from an extension module/builtin): from exec, execfile, from module name space (during import), from within a class definition, from within a method / classmethod / staticmethod, from a decorated function/method, from within a nested function, … – so there is no “calling function” in general, and the … Read more