GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — bpo-35134: Remove the Include/code.h header file by vstinner · Pull Request #32385 · python/cpython

Conversation

@vstinner

@vstinner vstinner commented Apr 6, 2022 •
edited by bedevere-bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@vstinner
vstinner requested review from a team, iritkatriel, markshannon and tiran as code owners April 6, 2022 22:58
@bedevere-bot bedevere-bot added the awaiting core review label Apr 6, 2022
@the-knights-who-say-ni the-knights-who-say-ni added the CLA signed label Apr 6, 2022
@vstinner

vstinner commented Apr 6, 2022

Copy link
Copy Markdown
Member Author

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
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

vstinner added 2 commits April 7, 2022 01:27
@vstinner
bpo-35134: Remove the Include/code.h header file
248b4a7
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
Add #ifndef Py_LIMITED_API
f8ec95b
@vstinner
vstinner merged commit 85addfb into python:main Apr 7, 2022
@bedevere-bot bedevere-bot removed the awaiting core review label 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
@tacaswell
BLD: do not include now private header files
4b83f9e
As of python/cpython#32385 the header
code.h is private but directly included into Python.h
@tacaswell tacaswell mentioned this pull request May 10, 2022
BLD: do not include now private header files python/typed_ast#188
Merged
hauntsaninja pushed a commit to python/typed_ast that referenced this pull request May 10, 2022
@tacaswell
Do not include now private code.h (#188)
617620f
As of python/cpython#32385 the header
code.h is private but directly included into Python.h
@ezio-melotti ezio-melotti mentioned this pull request Nov 14, 2022
Use :cpy-file: throughout the Devguide python/devguide#984
Merged
@vstinner vstinner mentioned this pull request Apr 10, 2022
Add a new Include/cpython/ subdirectory for the "CPython API" with implementation details #79315
Closed
@ezio-melotti ezio-melotti mentioned this pull request Dec 9, 2022
Fix links to missing CPython files python/devguide#1003
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@tiran tiran Awaiting requested review from tiran
@iritkatriel iritkatriel Awaiting requested review from iritkatriel
@markshannon markshannon Awaiting requested review from markshannon markshannon is a code owner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@vstinner @the-knights-who-say-ni @bedevere-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.