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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters