Hi:

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:

def Wrap(frame,event,arg):
     if event == 'call':
        result = PerformCheck(GetArgumentsFromFrame(frame))
        if Condition(result):
            return result
        else:
            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?

Thanks!
Dan
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to