[Python-Dev] Make the stable API-ABI usable

Victor Stinner victor.stinner at gmail.com
Sat Nov 18 04:13:36 EST 2017


Le 18 nov. 2017 08:32, "Serhiy Storchaka" <storchaka at gmail.com> a écrit :

Making PyTuple_GET_ITEM() a function will destroy the half of the benefit.
And this will make the ABI larger.


Sorry if I wasn't explicit about it: my idea of changing the API has an
obvious impact on performance. That's why the first step on the second
milestone of my plan is to spend time to measure the slowdown.

The other part of the my overall plan is to experiement new optimizations.
See my draft PEP for ideas.

The idea behind adding PyTuple_GET_ITEM() is to be able to compile C
extensions using it, without having to modify the code. If you require to
modify the code, I don't expect that you will be able to compile more than
half of C extensions on PyPI, like old code with no active maintainer...

Anyway, the PyTuple_GET_ITEM() will remain a macro in the default API for
Python 3.7.

See also my blog post which explains why the fact that it is a macro
prevents us from optimizing it, like having specialized compact tuple for
small integers.

Victor
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20171118/7fe303d9/attachment.html>


More information about the Python-Dev mailing list