Skip to content

Conversation

@Yashp002
Copy link
Contributor

@Yashp002 Yashp002 commented Jan 6, 2026

gh-141004: Document unstable executable kind macros in pyframe.h

This PR documents the PyUnstable_EXECUTABLE_KIND_* macros and the PyUnstable_ExecutableKinds array in Doc/c-api/frame.rst. These were listed as undocumented in the parent issue.


📚 Documentation preview 📚: https://cpython-previews--143490.org.readthedocs.build/

@bedevere-app bedevere-app bot added docs Documentation in the Doc dir skip news labels Jan 6, 2026
@github-project-automation github-project-automation bot moved this to Todo in Docs PRs Jan 6, 2026
Index for the "skip" kind in ``PyUnstable_ExecutableKinds``.
Indicates that the frame's code object should be skipped.
.. versionadded:: 3.12
Copy link
Member

Choose a reason for hiding this comment

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

9c03215 was not backported to 3.12?

@encukou
Copy link
Member

encukou commented Jan 7, 2026

These are rather useless without docs for PyUnstable_ExecutableKinds.
Once you document that, you can associate the macros with it, like for example Py_MOD_GIL_USED with Py_mod_gil.

@Yashp002
Copy link
Contributor Author

Yashp002 commented Jan 7, 2026

@encukou ok, makes sense. I'll add the documentation for PyUnstable_ExecutableKinds and link these macros to it. Thanks :)

Comment on lines 255 to 257
An enumeration of the different kinds of executables (code objects) in a frame.
This can be one of the constants :c:macro:`PyUnstable_EXECUTABLE_KIND_SKIP`
or :c:macro:`PyUnstable_EXECUTABLE_KIND_PY_FUNCTION`.
Copy link
Member

Choose a reason for hiding this comment

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

It's an array, not an enum.
Could you document what it's useful for or how to use it? That part isn't very clear to me.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Please go through what i've mentioned below and let me know if its perfectly appropriate, and as soon I recieve the heads up i'll update and commit:

.. c:var:: PyUnstable_ExecutableKinds

An array of executable kinds (executor types) for frames, used for internal
debugging and tracing. The entries are indexed by the constants
:c:macro:PyUnstable_EXECUTABLE_KIND_SKIP or
:c:macro:PyUnstable_EXECUTABLE_KIND_PY_FUNCTION.

This can be used to identify the type of the code object associated with a frame.

.. versionadded:: 3.13

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Could @encukou or @StanFromIreland please review my suggestion above and correct it if its wrong or gimme the green light to commit this ⬆️

Copy link
Member

Choose a reason for hiding this comment

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

I'd prefer some words on why/how you'd use this.

You can say “The entries are indexed by the following constants:”, and indent the docs for the constants. Since the entries are all similar, you could even use a compact table, like in code object flags.

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.

You need to update ignored_c_api.txt here too.

Comment on lines 296 to 298
Copy link
Member

Choose a reason for hiding this comment

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

Too many blank lines.

.. c:macro:: PyUnstable_EXECUTABLE_KIND_PY_FUNCTION
Index for the "Python function" kind in ``PyUnstable_ExecutableKinds``.
Copy link
Member

Choose a reason for hiding this comment

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

These should be links via :c:data:`PyUnstable_ExecutableKinds`

@Yashp002
Copy link
Contributor Author

Yashp002 commented Jan 8, 2026

test_asyncio.test_sendfile port conflict - unrelated to docs.

@StanFromIreland
Copy link
Member

StanFromIreland commented Jan 8, 2026

We don't need those tests to run at all really, we can (I think) exclude the ignore file from triggering the run-tests condition.

Edit: See #143583.

@Yashp002
Copy link
Contributor Author

Yashp002 commented Jan 8, 2026

We don't need those tests to run at all really, we can (I think) exclude the ignore file from triggering the run-tests condition.

Edit: See #143583.

Can the same be said for #143492
and #143494 then? @StanFromIreland

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

Labels

awaiting review docs Documentation in the Doc dir skip news

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

4 participants