Injecting code into a function

Lonnie Princehouse finite.automaton at gmail.com
Tue Apr 26 13:35:03 EDT 2005


> I think that Your trace_returns function is actually a global trace
> that returns itself and does not handle the 'call' event.

By returning itself, the global trace also becomes the local trace.
The code in bdb.py does the same thing---  self.trace_dispatch is set
as the global trace, and returns self.trace_dispatch via
self.dispatch_call(frame, arg)




More information about the Python-list mailing list