[Python-Dev] Make the stable API-ABI usable
solipsis at pitrou.net
Sun Nov 19 05:59:04 EST 2017
On Sun, 19 Nov 2017 00:18:28 +0100
Victor Stinner <victor.stinner at gmail.com> wrote:
> Le 18 nov. 2017 10:44, "Serhiy Storchaka" <storchaka at gmail.com> a écrit :
> The simplest way to do this:
> #define PyTuple_GET_ITEM PyTuple_GetItem
> This will not add new names to ABI. Such defines can be added in a separate
> header file included for compatibility.
> It is exactly what I am proposing :-)
But those do not have the same semantics. PyTuple_GetItem() checks its
arguments and raises an error if you pass it something else than a
tuple, or if the index is out of bounds. PyTuple_GET_ITEM(), however,
will crash if you do so.
More information about the Python-Dev