Refactor common code out of globaltrace_trackcallers() and
globaltrace_countfuncs() into file_module_function_of(). In that function use Michael Hudson's suggestion of gc.get_referrers() to back up from the code object to a function, then to a class's dict and finally to a class object if one exists.
Showing
Please register or sign in to comment