Victor,
I don't think this is a regression.
`PyThreadState` is an internal opaque data structure, which means we are free to change it.
That the `eval_frame` is hard to access is a feature not a bug, as it discourages misuse and enables us to remove it easily, when a better approach becomes available.
PEP 523 is quite vague, but the rationale indicates that exposing `eval_frame` is for "a method-level JIT". PEP 523 did not suggest adding an API. If it had (and I had had the time) I would have opposed it more vigorously.
IMO, the correct way to change the code object is to set `function.__code__` which can be done easily from either Python or C code.
@Fabioz, is there anything preventing you from doing that? |