This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author gvanrossum
Recipients Mark.Shannon, Xtrem532, erlendaasland, gvanrossum, hroncok, jpe, lukasz.langa, miss-islington, pablogsal, petr.viktorin, rhettinger, scoder, vstinner
Date 2021-09-25.04:00:35
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1632542435.31.0.927340141401.issue43760@roundup.psfhosted.org>
In-reply-to
Content
Ah, I think the docs need to be clarified a bit. Here's what I was missing:

The key thing to know here is that there are *three* state variables; `c_tracefunc`, `c_profilefunc` (on the thread state), and `use_tracing` (on the C frame).

Normally `use_tracing` is initialized to false if both functions are NULL, and true otherwise (if at least one of the functions is set).

*Disabling* means setting `use_tracing` to false regardless. *Resetting* means setting `use_tracing` to the value computed above.

There's also a fourth variable, `tstate->tracing`, which indicates whether a tracing function is active (i.e., it has been called and hasn't exited yet). This can be incremented and decremented. But none of the proposed APIs affect it.

Would it be reasonable to just put these APIs in pythoncapi_compat, instead of in the stdlib? (It would be yet one more selling point for people to start using that. :-)
History
Date User Action Args
2021-09-25 04:00:35gvanrossumsetrecipients: + gvanrossum, rhettinger, jpe, scoder, vstinner, petr.viktorin, lukasz.langa, Mark.Shannon, hroncok, pablogsal, miss-islington, erlendaasland, Xtrem532
2021-09-25 04:00:35gvanrossumsetmessageid: <1632542435.31.0.927340141401.issue43760@roundup.psfhosted.org>
2021-09-25 04:00:35gvanrossumlinkissue43760 messages
2021-09-25 04:00:35gvanrossumcreate