File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -269,29 +269,8 @@ Unless using :pep:`523`, you will not need this.
269269 * - .. c:macro:: PyUnstable_EXECUTABLE_KIND_METHOD_DESCRIPTOR
270270 - The frame corresponds to a method on a class instance.
271271
272- However, Python's C API lacks a function to read the executable kind from
273- a frame. Instead, use this recipe:
274-
275- .. code-block:: c
276-
277- int
278- get_executable_kind(PyFrameObject *frame)
279- {
280- _PyInterpreterFrame *f = frame->f_frame;
281- PyObject *exec = PyStackRef_AsPyObjectBorrow(f->f_executable);
282-
283- if (PyCode_Check(exec)) {
284- return PyUnstable_EXECUTABLE_KIND_PY_FUNCTION;
285- }
286- if (PyMethod_Check(exec)) {
287- return PyUnstable_EXECUTABLE_KIND_BUILTIN_FUNCTION;
288- }
289- if (Py_IS_TYPE(exec, &PyMethodDescr_Type)) {
290- return PyUnstable_EXECUTABLE_KIND_METHOD_DESCRIPTOR;
291- }
292-
293- return PyUnstable_EXECUTABLE_KIND_SKIP;
294- }
272+ Note that reading the executable kind from a frame is currently only
273+ possible with undocumented internal APIs.
295274
296275 .. versionadded:: 3.13
297276
You can’t perform that action at this time.
0 commit comments