[issue38500] Provide a way to get/set PyInterpreterState.frame_eval without needing to access interpreter internals
Eric Snow
report at bugs.python.org
Fri Nov 1 17:24:45 EDT 2019
Eric Snow <ericsnowcurrently at gmail.com> added the comment:
It depends on how you look at the degree to which you are interacting with the runtime. This is a fairly low-level hook into the runtime. So arguably if you are using this API then you should specify being a "core" extension. That said, getting that clever about it is a bit too much. The authors or PEP 523 can correct me if I'm wrong, but it seems like there isn't a good reason to restrict access.
So basically, I agree with you. :)
How about one of the following?
* _PyInterpreterState_SetEvalFrame(_PyFrameEvalFunction eval_frame)
* _PyInterpreterState_SetFrameEval(_PyFrameEvalFunction eval_frame)
The underscore basically says "don't use this unless you know what you are doing". Or perhaps that is overkill too? "_PyFrameEvalFunction" has an underscore, so perhaps not.
Also, it would make sense to have a matching getter.
----------
nosy: +brett.cannon, dino.viehland
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue38500>
_______________________________________
More information about the Python-bugs-list
mailing list