-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
bpo-38500: Add _PyInterpreterState_SetEvalFrameFunc() #17340
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I'm holding off on looking at this until the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change itself LGTM. However, I'm still not convinced that this is functionality we want to expose through the public API. So that question should be resolved before merging this. :)
(@brettcannon The question of passing tstate to the eval function seems unrelated.)
Also, it would probably make sense to have an explicit mention of this in whatsnew doc (porting section?). |
@ericsnowcurrently I think the |
Python 3.8.0 is now released. The internal C API can be used to access |
I plan to merge my PR 17340 at the end of week to not miss Python 3.9 feature freeze deadline, unless someone speaks up and find a good reason to not merge this PR. The PR adds a public C API PyInterpreterState_SetEvalFrameFunc() and now pass tstate to the frame evaluation function. Please go to https://bugs.python.org/issue38500 for discussion, don't discuss the topic here. |
@DinoV @ericsnowcurrently @brettcannon: Would you mind to review the update PR? |
The Windows ARM job of Azure Pipelines PR failed on downloading dependencies ("urllib.error.HTTPError: HTTP Error 401: UNAUTHORIZED"). I will wait for reviews before restarting the job. Right now, I don't need a green CI, I don't plan to merge this PR before the end of the week. |
@rsumner868: Hi, I saw you approving a few PRs. Would you mind to elaborate what you reviewed and explain why/how you approve a PR? This PR is controversial, you cannot simply approve it with no message. |
As I've reiterated in https://bugs.python.org/issue38500, I am strongly opposed to this being merged. |
PyInterpreterState.eval_frame function now requires a tstate (Python thread state) parameter. Add private functions to the C API to get and set the frame evaluation function: * Add tstate parameter to _PyFrameEvalFunction function type. * Add _PyInterpreterState_GetEvalFrameFunc() and _PyInterpreterState_SetEvalFrameFunc() functions. * Add tstate parameter to _PyEval_EvalFrameDefault().
I took @markshannon's concerns in account and I updated my PR to only add private functions to the C API, not public functions. |
@vstinner Thank you for making these functions private. However, if they are documented in the |
I prefer to document them. The feature is part of the PEP 523 and we already had this discussion :-) |
PyInterpreterState.eval_frame function now requires a tstate (Python
thread state) parameter.
Add private functions to the C API to get and set the frame
evaluation function:
_PyInterpreterState_SetEvalFrameFunc() functions.
https://bugs.python.org/issue38500