On Wed, Apr 20, 2022 at 1:44 PM Antoine Pitrou firstname.lastname@example.org wrote:
For consumers of the C API (C extensions, Cython, pybind11, etc.), once most implementation details will be hidden, the C API will become way more stable.
The *API* is quite stable already if you don't use the private/internal functions. Perhaps you're thinking about the ABI?
In Fedora, we update Python early during Python alpha versions, and sadly it's common that many C extensions are incompatible (need to be modified) at each 3.x release. A single minor incompatible change is enough to require changing a C extension.
I believe that once the C API will leak less implementation details, changing Python will impact less C extensions. HPy API looks more stable by design: it's way smaller and only expose the bare minimum.
I took notes on (Python and C API) incompatible changes, impacting most Python projects and C extensions, from Python 3.7 to Python 3.11: https://github.com/vstinner/vstinner.github.io/blob/pelican/draft/python-inc...
"C API > Porting to Python 3.11" section is quite long, PyFrameObject and PyThreadState structures changed a lot (PyFrameObject moved to the internal C API): https://docs.python.org/dev/whatsnew/3.11.html#id6
"C API > Porting to Python 3.10": https://docs.python.org/dev/whatsnew/3.10.html#id2
"C API > Porting to Python 3.9": https://docs.python.org/dev/whatsnew/3.9.html#id2
"Porting to Python 3.8 > Changes in C API": https://docs.python.org/dev/whatsnew/3.8.html#changes-in-the-c-api