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

Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix 5 pyframe
  • Loading branch information
Yashp002 committed Jan 22, 2026
commit 927383b71b9b315b3482a9233fe24d92df431787
17 changes: 10 additions & 7 deletions Doc/c-api/frame.rst
Original file line number Diff line number Diff line change
Expand Up @@ -265,20 +265,23 @@ Unless using :pep:`523`, you will not need this.

* - Constant
- Description
* - :c:macro:`PyUnstable_EXECUTABLE_KIND_SKIP`
* - .. c:macro:: PyUnstable_EXECUTABLE_KIND_SKIP
- The frame is internal (e.g. inlined) and should be skipped by tools.
* - :c:macro:`PyUnstable_EXECUTABLE_KIND_PY_FUNCTION`
* - .. c:macro:: PyUnstable_EXECUTABLE_KIND_PY_FUNCTION
- The frame corresponds to a standard Python function.

.. versionadded:: 3.13
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The .. versionadded:: ... should be the last thing in a function's/macro's/type's/etc. doc, please move it after the example.


Example usage:

.. c:macro:: PyUnstable_EXECUTABLE_KIND_SKIP
.. code-block:: c

Index for the "skip" kind in :c:data:`PyUnstable_ExecutableKinds`.
Indicates that the frame's code object should be skipped.

.. versionadded:: 3.13
// Check if a frame should be skipped
if (kind == PyUnstable_EXECUTABLE_KIND_SKIP) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What is kind? How do you get it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@encukou kind here refers to the executable kind field stored in the frame's executor (e.g. _PyFrame_GetExecutableKind(frame))
Do you think it's better to explicitly show _PyFrame_GetExecutableKind (if exposed), or should I just remove the example block to avoid confusion?

Copy link
Copy Markdown
Member

@encukou encukou Feb 3, 2026

Choose a reason for hiding this comment

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

Yes, explicitly show your _PyFrame_GetExecutableKind. We'll also need to make it public (or at least unstable) if we want users to use it.

// This is an internal frame (like a Tier 2 optimizer frame)
// Tools should ignore it.
continue;
}


.. c:macro:: PyUnstable_EXECUTABLE_KIND_PY_FUNCTION
Expand Down