-
-
Notifications
You must be signed in to change notification settings - Fork 34.4k
gh-146636: PEP 803: Reference documentation #148013
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
8e203eb
c1d7fef
f83f6b4
b3e31c6
2372da9
b3799de
3bc47ee
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -82,6 +82,7 @@ Summary -- Release highlights | |||||
| <whatsnew315-typeform>` | ||||||
| * :pep:`782`: :ref:`A new PyBytesWriter C API to create a Python bytes object | ||||||
| <whatsnew315-pybyteswriter>` | ||||||
| * :pep:`803`: :ref:`Stable ABI for Free-Threaded Builds <whatsnew315-abi3t>` | ||||||
| * :ref:`The JIT compiler has been significantly upgraded <whatsnew315-jit>` | ||||||
| * :ref:`Improved error messages <whatsnew315-improved-error-messages>` | ||||||
| * :ref:`The official Windows 64-bit binaries now use the tail-calling interpreter | ||||||
|
|
@@ -381,6 +382,41 @@ agen() for x in a)``. | |||||
|
|
||||||
| (Contributed by Adam Hartz in :gh:`143055`.) | ||||||
|
|
||||||
| .. _whatsnew315-abi3t: | ||||||
|
|
||||||
| :pep:`803`: ``abi3t`` -- Stable ABI for Free-Threaded Builds | ||||||
| ------------------------------------------------------------ | ||||||
|
|
||||||
| C extensions that target the :ref:`Stable ABI <stable-abi>` can now be | ||||||
| compiled for the new *Stable ABI for Free-Threaded Builds* (also known | ||||||
| as ``abi3t``), which makes them compatible with | ||||||
| :term:`free-threaded <free-threaded build>` builds of CPython. | ||||||
|
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.
Suggested change
|
||||||
| This usually requires some non-trivial changes to the source code; | ||||||
| specifically: | ||||||
|
|
||||||
| - Switching to API introduced in :pep:`697` (Python 3.12), such as | ||||||
| negative :c:member:`~PyType_Spec.basicsize` and | ||||||
| :c:func:`PyObject_GetTypeData`, rather than making :c:type:`PyObject` | ||||||
| part of the instance struct; and | ||||||
| - Switching from a ``PyInit_`` function to a new export hook, | ||||||
| :c:func:`PyModExport_* <PyModExport_modulename>`, introduced for this | ||||||
| purpose in :pep:`793`. | ||||||
|
|
||||||
| Note that Stable ABI does not offer all the functionality that CPython | ||||||
| has to offer. | ||||||
| Extensions that cannot switch to ``abi3t`` should continue to build for | ||||||
| the existing Stable ABI (``abi3``) and the version-specific ABI for | ||||||
| free-threading (``cp315t``) separately. | ||||||
|
|
||||||
| Stable ABI for Free-Threaded Builds should typically | ||||||
| be selected in a build tool (such as Setuptools, meson-python, Cython, | ||||||
|
Contributor
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. Maybe split this between build backends and bindings generators? Both probably need configuration. It's a little confusing to group Cython in with meson-python. |
||||||
| Scikit-build-core, Maturin, and similar). | ||||||
|
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. Don't really need "and similar" after "such as".
Suggested change
|
||||||
| At the time of writing this entry, these tools did **not** support ``abi3t``. | ||||||
|
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.
Suggested change
|
||||||
| If this is the case for your tool, compile for ``cp315t`` separately. | ||||||
| If not using a build tool -- or when writing such a tool -- you can select | ||||||
| ``abi3t`` by setting the macro :c:macro:`!Py_TARGET_ABI3T` as discussed | ||||||
ZeroIntensity marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
| in :ref:`abi3-compiling`. | ||||||
|
|
||||||
|
|
||||||
| .. _whatsnew315-improved-error-messages: | ||||||
|
|
||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Implement :pep:`803` -- ``abi3t``: Stable ABI for Free-Threaded Builds. |
Uh oh!
There was an error while loading. Please reload this page.
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.
This is all covered above, but for people who land here with a direct link to this section, you could add a cross-reference suggesting the
PyModExportAPI instead?