[issue43244] Move PyArena C API to the internal C API

STINNER Victor report at bugs.python.org
Thu Mar 25 09:56:23 EDT 2021


STINNER Victor <vstinner at python.org> added the comment:

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.

* The PyParser C API produced "node*" objects, like PyParser_SimpleParseFile(FILE*) => node*. This C API was removed in Python 3.10: bpo-40939 "Remove the old parser".

* The AST C API takes "node*" as input: PyAST_FromNode(node*) => mod_ty. I removed these APIs.

* symtable takes "mod_ty" as input.

* ASDL and PyArena API were only useful for the removed AST C APIs.

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.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43244>
_______________________________________


More information about the Python-bugs-list mailing list