Skip to content

Commit fce0d99

Browse files
committed
Docs: Expand the intro for C API stability
1 parent 290e405 commit fce0d99

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

Doc/c-api/stable.rst

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
C API Stability
77
***************
88

9-
Python's C API is covered by the Backwards Compatibility Policy, :pep:`387`.
9+
Unless documented otherwise, Python's C API is covered by the Backwards
10+
Compatibility Policy, :pep:`387`.
1011
Most changes to it are source-compatible (typically by only adding new API).
1112
Changing existing API or removing API is only done after a deprecation period
1213
or to fix serious issues.
@@ -17,13 +18,25 @@ way; see :ref:`stable-abi-platform` below).
1718
So, code compiled for Python 3.10.0 will work on 3.10.8 and vice versa,
1819
but will need to be compiled separately for 3.9.x and 3.10.x.
1920

21+
There are two tiers of API with different stability exepectations:
22+
23+
- *Unstable API*, ``PyUnstable`` prefix, may change in minor versions
24+
without a deprecation period.
25+
- *Limited API*, enabled by defining :c:macro:`Py_LIMITED_API`,
26+
is compatible across several minor releases.
27+
28+
These are discussed in more detail below.
29+
2030
Names prefixed by an underscore, such as ``_Py_InternalState``,
2131
are private API that can change without notice even in patch releases.
32+
If you need to use this API, consider reaching out to
33+
`CPython developers <mailto:[email protected]>`_ to discusss adding
34+
external API for your use case.
2235

23-
.. _unstable-c-api::
36+
.. _unstable-c-api:
2437

2538
Unstable C API
26-
=================
39+
==============
2740

2841
.. index:: single: PyUnstable
2942

0 commit comments

Comments
 (0)