Thanks to visit codestin.com
Credit goes to github.com

Skip to content

gh-131776: Expose functions called from the interpreter loop via PyAP… #134242

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

DinoV
Copy link
Contributor

@DinoV DinoV commented May 19, 2025

These APIs are used in CPython's interpreter loop. Alternate interpreter loops can be created using the cases_generator script with an additional input file that can be plugged in using PEP 523. But because these functions aren't exposed it's not possible to actually fully create these alternative interpreter loops without copying and pasting large amounts of code.

@DinoV DinoV requested a review from pablogsal May 19, 2025 15:40
@DinoV DinoV requested a review from vstinner May 19, 2025 16:23
Copy link
Member

@ZeroIntensity ZeroIntensity left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it too much to ask for these to be renamed to PyUnstable?

@DinoV
Copy link
Contributor Author

DinoV commented May 19, 2025

Is it too much to ask for these to be renamed to PyUnstable?

I'm happy to defer on that, but would be fine renaming them if that seems better. But they're buried in the internal APIs and require defining Py_BUILD_CORE to use which means you're already taking a responsibility on if you want to use them. Also there are currently no PyUnstable functions declared at all in the internal header files (even though there are hundreds of exported functions).

@DinoV DinoV removed the needs backport to 3.14 bugs and security fixes label May 19, 2025
@vstinner
Copy link
Member

Is it too much to ask for these to be renamed to PyUnstable?

PyUnstable functions require documentation and tests.

Comment on lines +92 to +93
PyAPI_FUNC(PyObject *) _PyType_LookupSubclasses(PyTypeObject *);
PyAPI_FUNC(PyObject *) _PyType_InitSubclasses(PyTypeObject *);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It feels a little off, putting the dict out there to be modified. What do you need this for, specifically? Can we provide some specific operation (like "set a dict watcher") rather than exposing the whole dict?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants