Move PyArena C API to the internal C API #87410
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
assignee = None closed_at = <Date 2021-03-24.01:26:54.289> created_at = <Date 2021-02-17.18:31:30.182> labels = ['expert-C-API', '3.10'] title = 'Move PyArena C API to the internal C API' updated_at = <Date 2021-05-26.22:44:01.883> user = 'https://github.com/vstinner'
activity = <Date 2021-05-26.22:44:01.883> actor = 'vstinner' assignee = 'none' closed = True closed_date = <Date 2021-03-24.01:26:54.289> closer = 'vstinner' components = ['C API'] creation = <Date 2021-02-17.18:31:30.182> creator = 'vstinner' dependencies =  files =  hgrepos =  issue_num = 43244 keywords = ['patch'] message_count = 19.0 messages = ['387180', '388973', '388976', '388981', '389001', '389016', '389018', '389075', '389408', '389416', '389419', '389423', '389424', '389501', '390416', '390444', '390472', '390473', '394489'] nosy_count = 2.0 nosy_names = ['vstinner', 'shihai1991'] pr_nums = ['24688', '24907', '24908', '24910', '24911', '24912', '24913', '24914', '24933', '25000', '25001', '25007', '25242', '25243', '25252', '25256'] priority = 'normal' resolution = 'fixed' stage = 'resolved' status = 'closed' superseder = None type = None url = 'https://bugs.python.org/issue43244' versions = ['Python 3.10']
The text was updated successfully, but these errors were encountered:
Include/cpython/pyarena.h declares 4 functions which are implemented in Python/pyarena.c. The header file exists to access these functions from the compiler. IMO there was no intent to expose these functions to the public Python C API.
Moreover, the PEP-384 explicitly excludes this API from the stable ABI (from the limited C API).
I propose to move these functions to the internal C API.
Since these functions are no even documented, I don't think that a deprecation period is needed.
In short, this issue is a follow-up of bpo-40939.
These C API removal are related to the final step of the PEP-617 "New PEG parser for CPython": removal of the PyParser C API.
I searched for removed functions in the top PyPI 4000 projects, there is a single project on 4000: typed_ast. This typed_ast project is special, it copies directly code from CPython. Even after the C API removed, typed_ast can continue to use the internal C API, it only has to define the Py_BUILD_CORE_MODULE macro.