diff options
author | Nick Coghlan <ncoghlan@gmail.com> | 2013-03-07 13:14:44 (GMT) |
---|---|---|
committer | Nick Coghlan <ncoghlan@gmail.com> | 2013-03-07 13:14:44 (GMT) |
commit | 7d82c8621bb72035b2e36388d616533dacfc2e43 (patch) | |
tree | 2a2e8012534e21bdafeb4e8a369f0d1f25195a65 /Doc/c-api/stable.rst | |
parent | 4f1974496a2c718dfd8f5f5f332d24856dbce4ea (diff) | |
download | cpython-7d82c8621bb72035b2e36388d616533dacfc2e43.zip cpython-7d82c8621bb72035b2e36388d616533dacfc2e43.tar.gz cpython-7d82c8621bb72035b2e36388d616533dacfc2e43.tar.bz2 |
Close #15465: Document C API version macros
Mostly moving the existing macro docs over from the standard
library docs to the C API docs where they belong.
Patch by Kushal Das.
Diffstat (limited to 'Doc/c-api/stable.rst')
-rw-r--r-- | Doc/c-api/stable.rst | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/Doc/c-api/stable.rst b/Doc/c-api/stable.rst index 2688c1c..a7c9ef9 100644 --- a/Doc/c-api/stable.rst +++ b/Doc/c-api/stable.rst @@ -2,9 +2,9 @@ .. _stable: -********************************** -Stable Appliction Binary Interface -********************************** +*********************************** +Stable Application Binary Interface +*********************************** Traditionally, the C API of Python will change with every release. Most changes will be source-compatible, typically by only adding API, @@ -23,13 +23,15 @@ need to be recompiled to link with a newer one. Since Python 3.2, a subset of the API has been declared to guarantee a stable ABI. Extension modules wishing to use this API need to define -Py_LIMITED_API. A number of interpreter details then become hidden +``Py_LIMITED_API``. A number of interpreter details then become hidden from the extension module; in return, a module is built that works -on any 3.x version (x>=2) without recompilation. In some cases, the -stable ABI needs to be extended with new functions. Extensions modules -wishing to use these new APIs need to set Py_LIMITED_API to the -PY_VERSION_HEX value of the minimum Python version they want to -support (e.g. 0x03030000 for Python 3.3). Such modules will work +on any 3.x version (x>=2) without recompilation. + +In some cases, the stable ABI needs to be extended with new functions. +Extension modules wishing to use these new APIs need to set +``Py_LIMITED_API`` to the ``PY_VERSION_HEX`` value (see +:ref:`apiabiversion`) of the minimum Python version they want to +support (e.g. ``0x03030000`` for Python 3.3). Such modules will work on all subsequent Python releases, but fail to load (because of missing symbols) on the older releases. |