bpo-43244: Remove ast.h, asdl.h, Python-ast.h headers #24933
Conversation
I searched for typed_ast-1.4.2.tar.gz: this project contains copies of C and header files of CPython.
This project can be modified to copy Python 3.10 internal header files and be built with Py_BUILD_CORE_MODULE macro defined. Pygments-2.8.0.tar.gz: it's used in example files to test the project, these files are not built, Pygments colorizes text files.
odfpy-1.4.1.tar.gz: the tarball contains many virtual environment in an hidden .tox/ subdirectory. |
I searched for
In short, in the 4000 projects, typed_ast should be the only project impacted by this PR. typed_ast copies/paste code directly from CPython, so I'm not surprised that it's impacted by changes in the CPython ASDL and AST implementation :-) typed_ast can continue copying code from CPython, but may need to be built with Py_BUILD_CORE_MODULE macro defined. |
Ah, test_asyncio failed on the Windows x64 CI, known random test failure: https://bugs.python.org/issue43539 |
pycore_ast.h now contains definitions of functions defined in Python-ast.c and in ast.c. Is that a good thing, or do you prefer to keep two header files separated? I failed to find a better name of the generated header file (old Python-ast.h). |
Hm, Can we merge pycore_ast_state.h in pycore_ast.h? There just only have a |
Yes, but I would prefer to not do that. pycore_ast_state.h is included by pycore_interp.h and this header file is included by many C files. I would prefer to avoid including pycore_ast.h in C files since this header file is problematic, for example it requires |
PR rebased on master to fix a conflict on compile.h. |
Removed functions are undocumented. They are also excluded from the limited C API (and from the stable ABI). I updated the PR to mention that explicitly. I cannot find removed functions in Doc/c-api/:
|
These functions were undocumented and excluded from the limited C API. Most names defined by these header files were not prefixed by "Py" and so could create names conflicts. For example, Python-ast.h defined a "Yield" macro which was conflict with the "Yield" name used by the Windows <winbase.h> header. Use the Python ast module instead. * Move Include/asdl.h to Include/internal/pycore_asdl.h. * Move Include/Python-ast.h to Include/internal/pycore_ast.h. * Remove ast.h header file. * pycore_symtable.h no longer includes Python-ast.h.
Oops, I fixed a typo: fuctions => functions. |
These functions were undocumented and excluded from the limited C API. Most names defined by these header files were not prefixed by "Py" and so could create names conflicts. For example, Python-ast.h defined a "Yield" macro which was conflict with the "Yield" name used by the Windows <winbase.h> header. Use the Python ast module instead. * Move Include/asdl.h to Include/internal/pycore_asdl.h. * Move Include/Python-ast.h to Include/internal/pycore_ast.h. * Remove ast.h header file. * pycore_symtable.h no longer includes Python-ast.h.
These fuctions were undocumented and excluded from the limited C API.
Most names defined by these header files were not prefixed by "Py"
and so could create names conflicts. For example, Python-ast.h
defined a "Yield" macro which was conflict with the "Yield" name used
by the Windows <winbase.h> header.
Use the Python ast module instead.
https://bugs.python.org/issue43244