Skip to content

Commit 94faa07

Browse files
authored
bpo-43244: Remove ast.h, asdl.h, Python-ast.h headers (GH-24933)
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.
1 parent cd27af7 commit 94faa07

29 files changed

+931
-933
lines changed

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ PC/clinic/*.h linguist-generated=true
4747
Python/clinic/*.h linguist-generated=true
4848
Python/importlib.h linguist-generated=true
4949
Python/importlib_external.h linguist-generated=true
50-
Include/Python-ast.h linguist-generated=true
50+
Include/internal/pycore_ast.h linguist-generated=true
5151
Python/Python-ast.c linguist-generated=true
5252
Include/opcode.h linguist-generated=true
5353
Python/opcode_targets.h linguist-generated=true

Doc/whatsnew/3.10.rst

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1384,5 +1384,13 @@ Removed
13841384
it could not be used, because the ``symtable.h`` header file was excluded
13851385
from the limited C API.
13861386
1387-
The Python :mod:`symtable` module remains available and is unchanged.
1387+
Use Python :mod:`symtable` module instead.
1388+
(Contributed by Victor Stinner in :issue:`43244`.)
1389+
1390+
* Remove ``ast.h``, ``asdl.h``, and ``Python-ast.h`` header files.
1391+
These functions were undocumented and excluded from the limited C API.
1392+
Most names defined by these header files were not prefixed by ``Py`` and so
1393+
could create names conflicts. For example, ``Python-ast.h`` defined a
1394+
``Yield`` macro which was conflict with the ``Yield`` name used by the
1395+
Windows ``<winbase.h>`` header. Use the Python :mod:`ast` module instead.
13881396
(Contributed by Victor Stinner in :issue:`43244`.)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy