-
-
Notifications
You must be signed in to change notification settings - Fork 34.5k
gh-141004: Document unstable executable kind macros in pyframe.h
#143490
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 4 commits
1efbe41
4572008
54495a2
e8097b1
9c1492f
a0b1951
927383b
e51340a
3fafd77
45e9a6d
43e9c9f
efe7161
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -250,3 +250,49 @@ 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 | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
|
|
||
|
|
||
| .. c:macro:: PyUnstable_EXECUTABLE_KIND_SKIP | ||
|
|
||
| Index for the "skip" kind in ``PyUnstable_ExecutableKinds``. | ||
| Indicates that the frame's code object should be skipped. | ||
|
|
||
| .. versionadded:: 3.13 | ||
|
|
||
|
|
||
| .. c:macro:: PyUnstable_EXECUTABLE_KIND_PY_FUNCTION | ||
|
|
||
| Index for the "Python function" kind in ``PyUnstable_ExecutableKinds``. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These should be links via |
||
|
|
||
| .. versionadded:: 3.13 | ||
|
|
||
|
|
||
| .. c:macro:: PyUnstable_EXECUTABLE_KIND_BUILTIN_FUNCTION | ||
|
|
||
| Index for the "built-in function" kind in ``PyUnstable_ExecutableKinds``. | ||
|
|
||
| .. versionadded:: 3.13 | ||
|
|
||
|
|
||
| .. c:macro:: PyUnstable_EXECUTABLE_KIND_METHOD_DESCRIPTOR | ||
|
|
||
| Index for the "method descriptor" kind in ``PyUnstable_ExecutableKinds``. | ||
|
|
||
| .. versionadded:: 3.13 | ||
|
|
||
|
|
||
| .. c:macro:: PyUnstable_EXECUTABLE_KINDS | ||
|
|
||
| The number of entries in ``PyUnstable_ExecutableKinds``. | ||
|
|
||
| .. versionadded:: 3.13 | ||
|
|
||
|
|
||
|
|
||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Too many blank lines. |
||
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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_SKIPor: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
There was a problem hiding this comment.
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 ⬆️
There was a problem hiding this comment.
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.