gh-127253: Note that Stable ABI is about ABI stability#127254
gh-127253: Note that Stable ABI is about ABI stability#127254encukou merged 1 commit intopython:mainfrom
Conversation
ZeroIntensity
left a comment
There was a problem hiding this comment.
For whatever reason, this is causing Sphinx to spam reference target not found warnings. Is that related, or a known issue?
|
Known issue: the page lists all of the limited API, some of which is still undocumented. |
ZeroIntensity
left a comment
There was a problem hiding this comment.
LGTM, with one small comment.
| The Stable ABI prevents ABI issues, like linker errors due to missing | ||
| symbols or data corruption due to changes in structure layouts or function | ||
| signatures. | ||
| However, other changes in Python can change the *behavior* of extensions. |
There was a problem hiding this comment.
It might be worth adding a small example here (e.g., reference counts, per the motivating issue).
There was a problem hiding this comment.
I don't think one example would do. Reference counts are less of a motivating issue and more of the straw that broke the camel's back.
| Python 3.2 introduced the *Limited API*, a subset of Python's C API. | ||
| Extensions that only use the Limited API can be | ||
| compiled once and work with multiple versions of Python. | ||
| compiled once and be loaded on multiple versions of Python. |
There was a problem hiding this comment.
It would be better to use ABI Compatible here instead of loaded on as the latter means that extension module can be loaded which may not be the case if the extension uses any function which now raises error while importing.
There was a problem hiding this comment.
Thanks for the suggestion.
This intro is meant to communicate the intent of the limited API, rather than give the precise description. I'd rather leave the term “ABI Compatible” to the sections below, which should also clear up which “multiple versions” the extension will work with.
|
Thanks @encukou for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13. |
|
GH-127557 is a backport of this pull request to the 3.13 branch. |
|
GH-127558 is a backport of this pull request to the 3.12 branch. |
📚 Documentation preview 📚: https://cpython-previews--127254.org.readthedocs.build/