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

S

seberino

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?

Chris
 
?

=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=

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?

Yes, please take a look at sys.setprofile().

Regards,
Martin
 
B

Bengt Richter

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
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,731
Messages
2,569,432
Members
44,832
Latest member
GlennSmall

Latest Threads

Top