Set PyEval_SetTrace to method from class


I need to set a PyEval_SetTrace with a new class instance.

All examples use simple function.

PyEval_SetTrace(trace_trampoline, obj);

Following my problem:

I start three threads, but I need to check trace C just one thread.

If I run a while on C trace on thread, it stops all threads.

So, I’ve been thinking to run Trace with a new instance class C.

Any suggestions?