From 1efbe4123609a5eb7da3600ee059bf43481ff08e Mon Sep 17 00:00:00 2001 From: Yash Date: Tue, 6 Jan 2026 23:41:28 +0530 Subject: [PATCH 1/9] first unstable py --- Doc/c-api/frame.rst | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/Doc/c-api/frame.rst b/Doc/c-api/frame.rst index fb17cf7f1da6b2..0a8e18ed50fec7 100644 --- a/Doc/c-api/frame.rst +++ b/Doc/c-api/frame.rst @@ -250,3 +250,39 @@ Unless using :pep:`523`, you will not need this. .. versionadded:: 3.12 +.. c:macro:: PyUnstable_EXECUTABLE_KIND_SKIP + + Index for the "skip" kind in :c:var:`PyUnstable_ExecutableKinds`. + Indicates that the frame's code object should be skipped. + + .. versionadded:: 3.12 + + +.. c:macro:: PyUnstable_EXECUTABLE_KIND_PY_FUNCTION + + Index for the "Python function" kind in :c:var:`PyUnstable_ExecutableKinds`. + + .. versionadded:: 3.12 + + +.. c:macro:: PyUnstable_EXECUTABLE_KIND_BUILTIN_FUNCTION + + Index for the "built-in function" kind in :c:var:`PyUnstable_ExecutableKinds`. + + .. versionadded:: 3.12 + + +.. c:macro:: PyUnstable_EXECUTABLE_KIND_METHOD_DESCRIPTOR + + Index for the "method descriptor" kind in :c:var:`PyUnstable_ExecutableKinds`. + + .. versionadded:: 3.12 + + +.. c:macro:: PyUnstable_EXECUTABLE_KINDS + + The number of entries in :c:var:`PyUnstable_ExecutableKinds`. + + .. versionadded:: 3.12 + + From 45720082e947813a74d2b6c209b895738e3b98a8 Mon Sep 17 00:00:00 2001 From: Yash Date: Tue, 6 Jan 2026 23:55:06 +0530 Subject: [PATCH 2/9] fix 1 --- Doc/c-api/frame.rst | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Doc/c-api/frame.rst b/Doc/c-api/frame.rst index 0a8e18ed50fec7..d27a2661fed789 100644 --- a/Doc/c-api/frame.rst +++ b/Doc/c-api/frame.rst @@ -252,7 +252,7 @@ Unless using :pep:`523`, you will not need this. .. c:macro:: PyUnstable_EXECUTABLE_KIND_SKIP - Index for the "skip" kind in :c:var:`PyUnstable_ExecutableKinds`. + Index for the "skip" kind in ``PyUnstable_ExecutableKinds``. Indicates that the frame's code object should be skipped. .. versionadded:: 3.12 @@ -260,29 +260,30 @@ Unless using :pep:`523`, you will not need this. .. c:macro:: PyUnstable_EXECUTABLE_KIND_PY_FUNCTION - Index for the "Python function" kind in :c:var:`PyUnstable_ExecutableKinds`. + Index for the "Python function" kind in ``PyUnstable_ExecutableKinds``. .. versionadded:: 3.12 .. c:macro:: PyUnstable_EXECUTABLE_KIND_BUILTIN_FUNCTION - Index for the "built-in function" kind in :c:var:`PyUnstable_ExecutableKinds`. + Index for the "built-in function" kind in ``PyUnstable_ExecutableKinds``. .. versionadded:: 3.12 .. c:macro:: PyUnstable_EXECUTABLE_KIND_METHOD_DESCRIPTOR - Index for the "method descriptor" kind in :c:var:`PyUnstable_ExecutableKinds`. + Index for the "method descriptor" kind in ``PyUnstable_ExecutableKinds``. .. versionadded:: 3.12 .. c:macro:: PyUnstable_EXECUTABLE_KINDS - The number of entries in :c:var:`PyUnstable_ExecutableKinds`. + The number of entries in ``PyUnstable_ExecutableKinds``. .. versionadded:: 3.12 + From 54495a21df6b8e82caa9e3f77e468fc665177825 Mon Sep 17 00:00:00 2001 From: Yash Date: Wed, 7 Jan 2026 00:32:53 +0530 Subject: [PATCH 3/9] fix 2(version) --- Doc/c-api/frame.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Doc/c-api/frame.rst b/Doc/c-api/frame.rst index d27a2661fed789..6334b39f96f066 100644 --- a/Doc/c-api/frame.rst +++ b/Doc/c-api/frame.rst @@ -255,35 +255,35 @@ Unless using :pep:`523`, you will not need this. Index for the "skip" kind in ``PyUnstable_ExecutableKinds``. Indicates that the frame's code object should be skipped. - .. versionadded:: 3.12 + .. versionadded:: 3.13 .. c:macro:: PyUnstable_EXECUTABLE_KIND_PY_FUNCTION Index for the "Python function" kind in ``PyUnstable_ExecutableKinds``. - .. versionadded:: 3.12 + .. versionadded:: 3.13 .. c:macro:: PyUnstable_EXECUTABLE_KIND_BUILTIN_FUNCTION Index for the "built-in function" kind in ``PyUnstable_ExecutableKinds``. - .. versionadded:: 3.12 + .. versionadded:: 3.13 .. c:macro:: PyUnstable_EXECUTABLE_KIND_METHOD_DESCRIPTOR Index for the "method descriptor" kind in ``PyUnstable_ExecutableKinds``. - .. versionadded:: 3.12 + .. versionadded:: 3.13 .. c:macro:: PyUnstable_EXECUTABLE_KINDS The number of entries in ``PyUnstable_ExecutableKinds``. - .. versionadded:: 3.12 + .. versionadded:: 3.13 From e8097b1483ff84a20a3f87634ce0e73ba722e909 Mon Sep 17 00:00:00 2001 From: Yash Date: Wed, 7 Jan 2026 15:53:54 +0530 Subject: [PATCH 4/9] fix 2 pyframe --- Doc/c-api/frame.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Doc/c-api/frame.rst b/Doc/c-api/frame.rst index 6334b39f96f066..2ba472ff3935e2 100644 --- a/Doc/c-api/frame.rst +++ b/Doc/c-api/frame.rst @@ -250,6 +250,15 @@ Unless using :pep:`523`, you will not need this. .. versionadded:: 3.12 +.. c:enum:: PyUnstable_ExecutableKinds + + 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`. + + .. versionadded:: 3.13 + + .. c:macro:: PyUnstable_EXECUTABLE_KIND_SKIP Index for the "skip" kind in ``PyUnstable_ExecutableKinds``. From 9c1492fdf5b4f6897fd0b22e1a1f6ce026193000 Mon Sep 17 00:00:00 2001 From: Yash Date: Thu, 8 Jan 2026 22:04:25 +0530 Subject: [PATCH 5/9] fix 3 pyframe --- Doc/c-api/frame.rst | 27 +++++++++++++++++------- Tools/check-c-api-docs/ignored_c_api.txt | 6 ------ 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/Doc/c-api/frame.rst b/Doc/c-api/frame.rst index 2ba472ff3935e2..05d1a3bad64baa 100644 --- a/Doc/c-api/frame.rst +++ b/Doc/c-api/frame.rst @@ -250,18 +250,32 @@ Unless using :pep:`523`, you will not need this. .. versionadded:: 3.12 -.. c:enum:: PyUnstable_ExecutableKinds +.. c:var:: PyUnstable_ExecutableKinds - 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`. + An array of executable kinds (executor types) for frames, used for internal + debugging and tracing. + + Tools like debuggers and profilers can use this to identify the type of execution + context associated with a frame (e.g. to filter out internal frames). + The entries are indexed by the following constants: + + .. list-table:: + :header-rows: 1 + :widths: auto + + * - Constant + - Description + * - :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` + - The frame corresponds to a standard Python function. .. versionadded:: 3.13 .. c:macro:: PyUnstable_EXECUTABLE_KIND_SKIP - Index for the "skip" kind in ``PyUnstable_ExecutableKinds``. + Index for the "skip" kind in :c:data:`PyUnstable_ExecutableKinds`. Indicates that the frame's code object should be skipped. .. versionadded:: 3.13 @@ -293,6 +307,3 @@ Unless using :pep:`523`, you will not need this. The number of entries in ``PyUnstable_ExecutableKinds``. .. versionadded:: 3.13 - - - diff --git a/Tools/check-c-api-docs/ignored_c_api.txt b/Tools/check-c-api-docs/ignored_c_api.txt index e81ffd51e193b2..88551e09418a9e 100644 --- a/Tools/check-c-api-docs/ignored_c_api.txt +++ b/Tools/check-c-api-docs/ignored_c_api.txt @@ -80,12 +80,6 @@ PyLong_MASK PyLong_SHIFT # cpython/pyerrors.h PyException_HEAD -# cpython/pyframe.h -PyUnstable_EXECUTABLE_KINDS -PyUnstable_EXECUTABLE_KIND_BUILTIN_FUNCTION -PyUnstable_EXECUTABLE_KIND_METHOD_DESCRIPTOR -PyUnstable_EXECUTABLE_KIND_PY_FUNCTION -PyUnstable_EXECUTABLE_KIND_SKIP # cpython/pylifecycle.h Py_FrozenMain # cpython/unicodeobject.h From a0b1951886fb4b3583431b70960a0603dd0f381b Mon Sep 17 00:00:00 2001 From: Yash Date: Thu, 8 Jan 2026 23:53:35 +0530 Subject: [PATCH 6/9] fix 4 pyframe --- Doc/c-api/frame.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/c-api/frame.rst b/Doc/c-api/frame.rst index 05d1a3bad64baa..6f8b8ada1b168d 100644 --- a/Doc/c-api/frame.rst +++ b/Doc/c-api/frame.rst @@ -250,7 +250,7 @@ Unless using :pep:`523`, you will not need this. .. versionadded:: 3.12 -.. c:var:: PyUnstable_ExecutableKinds +.. c:type:: PyUnstable_ExecutableKinds An array of executable kinds (executor types) for frames, used for internal debugging and tracing. From 927383b71b9b315b3482a9233fe24d92df431787 Mon Sep 17 00:00:00 2001 From: Yash Date: Thu, 22 Jan 2026 16:26:57 +0530 Subject: [PATCH 7/9] fix 5 pyframe --- Doc/c-api/frame.rst | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/Doc/c-api/frame.rst b/Doc/c-api/frame.rst index 6f8b8ada1b168d..fa5061efe788b2 100644 --- a/Doc/c-api/frame.rst +++ b/Doc/c-api/frame.rst @@ -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 + 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) { + // This is an internal frame (like a Tier 2 optimizer frame) + // Tools should ignore it. + continue; + } .. c:macro:: PyUnstable_EXECUTABLE_KIND_PY_FUNCTION From 3fafd77d7a7b7e6319ca5bc48c84cd97d389b568 Mon Sep 17 00:00:00 2001 From: Yash Date: Thu, 22 Jan 2026 16:33:18 +0530 Subject: [PATCH 8/9] fix 6 pyframe --- Tools/check-c-api-docs/ignored_c_api.txt | 8 -------- 1 file changed, 8 deletions(-) diff --git a/Tools/check-c-api-docs/ignored_c_api.txt b/Tools/check-c-api-docs/ignored_c_api.txt index eb6b80e07690b9..97a411d5067fbc 100644 --- a/Tools/check-c-api-docs/ignored_c_api.txt +++ b/Tools/check-c-api-docs/ignored_c_api.txt @@ -75,14 +75,6 @@ Py_UniversalNewlineFgets PyUnstable_CopyPerfMapFile PyUnstable_PerfTrampoline_CompileCode PyUnstable_PerfTrampoline_SetPersistAfterFork -# cpython/genobject.h -PyAsyncGenASend_CheckExact -# cpython/longintrepr.h -PyLong_BASE -PyLong_MASK -PyLong_SHIFT -# cpython/pyerrors.h -PyException_HEAD # cpython/pylifecycle.h Py_FrozenMain # pythonrun.h From 45e9a6d8a58d2bca8ac20ea442a3ac699bd50edd Mon Sep 17 00:00:00 2001 From: Yash Date: Thu, 22 Jan 2026 17:44:47 +0530 Subject: [PATCH 9/9] pyframe fix 7 --- Doc/c-api/frame.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Doc/c-api/frame.rst b/Doc/c-api/frame.rst index fa5061efe788b2..97c2bdd7db6166 100644 --- a/Doc/c-api/frame.rst +++ b/Doc/c-api/frame.rst @@ -256,7 +256,7 @@ Unless using :pep:`523`, you will not need this. debugging and tracing. Tools like debuggers and profilers can use this to identify the type of execution - context associated with a frame (e.g. to filter out internal frames). + context associated with a frame (For example: to filter out internal frames). The entries are indexed by the following constants: .. list-table:: @@ -266,12 +266,10 @@ Unless using :pep:`523`, you will not need this. * - Constant - Description * - .. c:macro:: PyUnstable_EXECUTABLE_KIND_SKIP - - The frame is internal (e.g. inlined) and should be skipped by tools. + - The frame is internal (For example: inlined) and should be skipped by tools. * - .. c:macro:: PyUnstable_EXECUTABLE_KIND_PY_FUNCTION - The frame corresponds to a standard Python function. - .. versionadded:: 3.13 - Example usage: .. code-block:: c @@ -283,6 +281,8 @@ Unless using :pep:`523`, you will not need this. continue; } + .. versionadded:: 3.13 + .. c:macro:: PyUnstable_EXECUTABLE_KIND_PY_FUNCTION