Wrap and intercept function calls
dyamins at gmail.com
Wed Feb 17 01:29:55 CET 2010
I'm wondering what the best way to wrap and modify function calls is.
Essentially what I want to achieve is to have a function like this:
if event == 'call':
result = PerformCheck(GetArgumentsFromFrame(frame))
return [normal function call]
called whenever a "call" event is about to occur.
When I say "return result" I mean: return that data object instead of what
the function would have returned, and prevent execution of the function.
Is there any way to do this using sys.settrace? Or perhaps something from
the bdb or pbd module?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-list