Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-35134: Remove the Include/code.h header file #32385

Merged
merged 2 commits into from
Apr 7, 2022
Merged

bpo-35134: Remove the Include/code.h header file #32385

merged 2 commits into from
Apr 7, 2022

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Apr 6, 2022

Remove the Include/code.h header file. C extensions should only
include the main <Python.h> header file.

Python.h includes directly Include/cpython/code.h instead.

https://bugs.python.org/issue35134

@vstinner
Copy link
Member Author

vstinner commented Apr 6, 2022

None of the top 5000 PyPI projects include directly code.h:

$ ./search_pypi_top.py PYPI-2022-01-26-TOP-5000/ '# *include [<"]code.h[">]' -q
PYPI-2022-01-26-TOP-5000/Pygments-2.11.2.tar.gz: Pygments-2.11.2/tests/examplefiles/c/ceval.c: #include "code.h"
PYPI-2022-01-26-TOP-5000/typed_ast-1.5.2.tar.gz: typed_ast-1.5.2/ast27/Include/compile.h: #include "code.h"

Found 2 matching lines in 2 projects
  • Pygments only uses ceval.c has an example: this C file is not built
  • typed_ast ast27/Include/compile.h is only used on Python 2.7

Remove the Include/code.h header file. C extensions should only
include the main <Python.h> header file.

Python.h includes directly Include/cpython/code.h instead.
@vstinner vstinner merged commit 85addfb into python:main Apr 7, 2022
@vstinner vstinner deleted the remove_code_h branch April 7, 2022 00:29
tacaswell added a commit to tacaswell/typed_ast that referenced this pull request May 10, 2022
As of python/cpython#32385 the header
code.h is private but directly included into Python.h
hauntsaninja pushed a commit to python/typed_ast that referenced this pull request May 10, 2022
As of python/cpython#32385 the header
code.h is private but directly included into Python.h
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants