-
-
Notifications
You must be signed in to change notification settings - Fork 32.6k
gh-133143: Make information about the interpreter ABI more accessible #137476
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 all commits
d7f5f06
8890dc5
a6f7d2e
b6c945c
defb2b2
8364d78
3e1c98f
c895b1d
44200b3
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 |
---|---|---|
|
@@ -11,6 +11,24 @@ interpreter and to functions that interact strongly with the interpreter. It is | |
always available. Unless explicitly noted otherwise, all variables are read-only. | ||
|
||
|
||
.. data:: abi_info | ||
|
||
An object containing information about the ABI of the currently running | ||
Python interpreter. The following attributes are available in cpython: | ||
|
||
*pointer_bits* is the width of pointers in bits, as an integer, equivalent | ||
to ``8 * sizeof(void *)``, i.e. usually ``32`` or ``64``. | ||
|
||
*Py_GIL_DISABLED* is a boolean indicating whether the interpreter was built | ||
with the GIL disabled, i.e. with the :option:`--disable-gil` option, | ||
aka free-threading. | ||
|
||
*Py_DEBUG* is a boolean indicating whether the interpreter was built in | ||
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. You may rename the attribute to |
||
debug mode, i.e. with the :option:`--with-pydebug` option. | ||
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. Can you add a link on "debug mode" to https://docs.python.org/dev/using/configure.html#python-debug-build ? Something like:
|
||
|
||
.. versionadded:: next | ||
|
||
|
||
.. data:: abiflags | ||
|
||
On POSIX systems where Python was built with the standard ``configure`` | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Add ``sys.abi_info`` object to make ABI information more easily accessible. |
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 would prefer consistency between attribute names. For example, rename this one to
gil_disabled
.I also dislike negative options. Would it make sense to rename the attribute to
gil_enabled
? If would be False in a Free Threaded build.