On 06. 12. 21 20:29, Guido van Rossum wrote:
> Hi Petr,
>
> In PEP 384 it is written that no functions starting with an underscore
> are part of the stable ABI:
>
> PEP 384 -- Defining a Stable ABI | Python.org
> <https://www.python.org/dev/peps/pep-0384/#excluded-functions>
> > All functions starting with _Py are not available to applications
>
> OTOH there's a data file in the repo, Misc/stabe_abi.txt, which lists
> many functions starting with _Py_, for example _PyObject_GC_Malloc. Then
> again, that function is not listed in Doc/data/stable_abi.dat. (I didn't
> check other functions, but maybe there are others.)
>
> So is Misc/stable_abi.txt just out of date? Or how can the discrepancy
> be explained?
These are not part of the limited API, so extension authors can't use
them in the C source. But they typically are (or have been) called by
macros from the limited API. So, they are part of the stable ABI; they
need to be exported.
Misc/stable_abi.txt says "abi_only" for all of these. They don't show up
in the user-facing docs.
Thanks, that helps. It's too bad that there's no comment at the top explaining the format (in fact it appears to discourage reading the file?).
Also, it looks like Mark is proposing to *remove*
_PyObject_GC_Malloc from stable_abi.txt in
https://github.com/python/cpython/pull/29879 Is that allowed? If it's being used by a macro it means code using that macro will fail unless recompiled for 3.11.