Repository navigation
PyUnstable_ExecutableKinds is useless #152105
Description
Activity
- addedinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)
on Jun 24, 2026 I have no idea -- from #105727 I can't figure out how this should be used and why it's needed.
cc @iritkatriel, as the reviewer.Oh, here's a hint: #108651 (comment)
These constants are intended for tools like pyspy and austin, which are out-of-process tools.
They need to copy and paste the constants, so it doesn't matter to them whether they are private or unstable.
However, they could be useful for in-process tools as well, so making them "unstable" seems best.But, I could find no mention of ExecutableKinds in py-spy and austin.
I investigated this on current
main.From what I found,
PyUnstable_ExecutableKindsappears to be declared and defined, but not actually usable in practice:- I found no in-tree users besides its declaration/definition.
- I found no tests or documentation covering it.
- I could not find an API that maps a
PyFrameObjectto aPyUnstable_EXECUTABLE_KIND_*value. - The named external tools discussed previously, py-spy and Austin, do not appear to use
PyUnstable_ExecutableKindsor thePyUnstable_EXECUTABLE_KIND_*constants.
Given that, I think the current API is effectively orphaned. My preference would be to remove
PyUnstable_ExecutableKindsin 3.16 unless there is interest in reviving the broader non-code executable frame design from gh-100987.I’m happy to prepare a small removal PR if that direction sounds reasonable ?
@zainnadeem786, you've only repeated what's already covered above.
We are waiting for a comment by the people who added the API.Thanks for the clarification @encukou . I'll wait for the original design discussion before proposing any changes.
@zainnadeem786 When triaging, I encourage you to use your own words and judgment rather than feeding an issue into an LLM. I've noticed this kind of response is a common pattern with your contributions. We are humans; we prefer to talk to other humans too.
Thanks for the feedback, @ZeroIntensity.
I appreciate it.
For my investigations, I always reproduce the issue locally, inspect the relevant code, and verify my conclusions before commenting. I realize my comment came across more like a summary than my own reasoning, and I'll do a better job of emphasizing my own analysis and observations in future discussions.
Thanks for the guidance.
- added 4 commits that reference this issue
on Aug 5, 2026 Removed in #155244. If anyone has more info we can reopen.
We have some unstable APIs related to frame executables. We were looking into documenting them in #143490. These are defined at the bottom of
frame.c:cpython/Python/frame.c
Lines 153 to 159 in 0fb82b4
The idea is that users can use these to determine the type of
f_executablewithout accessing it -- but it seems we forgot to add an API to actually get one of thePyUnstable_EXECUTABLE_KIND*macros from a frame object! That means the only way to an entry out ofPyUnstable_ExecutableKindsis to know the type in advance, like this:But, if you already know the type, then you have no reason to access
PyUnstable_ExecutableKinds! For the future, let's decide on one of two options:get_executable_kindfunction described above as an unstable C API.cc @markshannon (author of #105727, where these were added), @encukou
Linked PRs