# Set PyEval\_SetTrace to method from class

**URL:** <https://discuss.python.org/t/set-pyeval-settrace-to-method-from-class/3824>\
**Category:** Python Help\
**Created:** [April 5, 2020, 3:41pm UTC](https://discuss.python.org/t/set-pyeval-settrace-to-method-from-class/3824 "2020-04-05T15:41:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Leandro\_Muller](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/leandro_muller/32/2034_2.png) [@Leandro\_Muller](https://discuss.python.org/u/Leandro_Muller)\
**Post date:** [April 5, 2020, 3:41pm UTC](https://discuss.python.org/t/set-pyeval-settrace-to-method-from-class/3824/1 "2020-04-05T15:41:03Z")

</div>

Hello.

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?
