How override ALL function calls? (Is there a "function call function"?)

Bengt Richter bokr at oz.net
Mon Aug 1 08:38:00 EDT 2005


On 31 Jul 2005 12:01:36 -0700, "seberino at spawar.navy.mil" <seberino at spawar.navy.mil> wrote:

>I'm trying run a homegrown profiler on some Python code.
>
>Rather than apply profiler wrapper to ALL functions by hand....
>
>Is there a low level Python function I can override to modify
>
>how ALL functions are called?
>
You may want to look at

 >>> import sys
 >>> help(sys.settrace)
 Help on built-in function settrace in module sys:

 settrace(...)
     settrace(function)

     Set the global debug tracing function.  It will be called on each
     function call.  See the debugger chapter in the library manual.

Regards,
Bengt Richter



More information about the Python-list mailing list