[Python-Dev] Make the stable API-ABI usable (original) (raw)

Antoine Pitrou solipsis at pitrou.net
Sat Nov 18 06:31:06 EST 2017


I agree with Serhiy. It doesn't make sense to add PyTuple_GET_ITEM to the stable ABI. People who want to benefit from the stable ABI should use PyTuple_GetItem. That's not very complicated.

Regards

Antoine.

On Sat, 18 Nov 2017 11:42:36 +0200 Serhiy Storchaka <storchaka at gmail.com> wrote:

18.11.17 11:13, Victor Stinner пише: > The idea behind adding PyTupleGETITEM() is to be able to compile C > extensions using it, without having to modify the code.

The simplest way to do this: #define PyTupleGETITEM PyTupleGetItem This will not add new names to ABI. Such defines can be added in a separate header file included for compatibility. In any case making PyTupleGETITEM() a function will break the following code: PyObject **items = &PyTupleGETITEM(tuple, 0); Pyssizet size = PyTupleGETSIZE(tuple, 0); foo(items, size);


Python-Dev mailing list Python-Dev at python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/python-python-dev%40m.gmane.org



More information about the Python-Dev mailing list