[proxy] github.com← back | site home | direct (HTTPS) ↗ | proxy home | ◑ dark◐ light

[WIP] bpo-35206: Add new experimental _Py_CAPI2 API by vstinner · Pull Request #10443 · python/cpython

vstinner

Add a new experimental "_Py_CAPI2" API: opt-in which doesn't leak
implementation details and replace macros with function calls. The
defined is called "_Py_CAPI2" and not "Py_CAPI2" because it must not
be used at this stage. The new API is experiment and can be removed
anytime.

With this API, PyTuple_GET_ITEM() macro becomes a function call and
the implementation uses assertions to check if the first argument is
a tuple and that the index is valid. It should help to investigate
bugs when Python is compiled in debug mode.

vstinner changed the title bpo-35206: Add new experimental _Py_CAPI2 API [WIP] bpo-35206: Add new experimental _Py_CAPI2 API

Nov 10, 2018