[capi-sig]Make the stable ABI usable
Hi Gustavo,
Le lundi 30 juillet 2018, Stefan Behnel python_capi@behnel.de a écrit :
Gustavo Carneiro schrieb am 30.07.2018 um 16:18:
What is the relation to PEP 384? https://www.python.org/dev/peps/pep-0384/
The "stable ABI" is a restricted API/ABI that breaks backwards compatibility with all extension modules out there. If you write code against this API, then you can make it work in newer CPython versions without recompilation. This does not apply to any previously existing C extension, which means that any changes to the non-stable parts of the C-API would still break the world.
Stefan
Replacing macros accessing structures fields with function calls makes the generated machine code compatible with the stable ABI: http://pythoncapi.readthedocs.io/stable_abi.html
And: http://pythoncapi.readthedocs.io/new_api.html#hide-implementation-details
It means that C extensions using PyList_GET_ITEM() become compatible with new Python runtimes using the stable ABI, without having to modify their code.
The PEP 384 requires to replace PyList_GET_ITEM() with PyList_GetItem(). I would like to continue the work on this PEP, to allow to use the stable ABI on more C extensions.
Victor
participants (6)
-
Andrew Svetlov
-
Eric Snow
-
Petr Viktorin
-
Ronald Oussoren
-
Stefan Behnel
-
Victor Stinner