18.11.17 03:05, Victor Stinner пише:
tl; dr I propose to extend the existing "stable API" to make it almost
as complete as the current API. For example, add back
PyTuple_GET_ITEM() to be stable API, but it becomes a function call
rather than a macro. The final question is if it's not too late to
iterate on an implementation of this idea for Python 3.7? Knowing that
the stable API doesn't affect the "current API" at all, since the "new
C API" (extended stable API) would only be accessible using an
*opt-in* flag.

There is the PyTuple_GetItem() function. The benefit of using PyTuple_GET_ITEM() in tight loops: a) avoid redundant arguments checks; b) avoid calling function overhead. Making PyTuple_GET_ITEM() a function will destroy the half of the benefit. And this will make the ABI larger.

First at all we need to document all API, what is stable, and in what version it had became stable.

Then I would separate three kinds of API physically: limited API, extended unstable API, and internal private API, and place their declarations in different headers. The headers with internal API should not even be visible for third-party developers.

_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to