Message402603
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. :-) |
|
Date |
User |
Action |
Args |
2021-09-25 04:00:35 | gvanrossum | set | recipients:
+ gvanrossum, rhettinger, jpe, scoder, vstinner, petr.viktorin, lukasz.langa, Mark.Shannon, hroncok, pablogsal, miss-islington, erlendaasland, Xtrem532 |
2021-09-25 04:00:35 | gvanrossum | set | messageid: <1632542435.31.0.927340141401.issue43760@roundup.psfhosted.org> |
2021-09-25 04:00:35 | gvanrossum | link | issue43760 messages |
2021-09-25 04:00:35 | gvanrossum | create | |
|