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: Move non-limited C API of include/compile.h into include/cpython. #24922

Merged
merged 3 commits into from
Mar 22, 2021

Conversation

shihai1991
Copy link
Member

@shihai1991 shihai1991 commented Mar 18, 2021

@shihai1991
Copy link
Member Author

shihai1991 commented Mar 18, 2021

@vstinner Hi, Victor. When you plan to rewrite pyarena.h, I think this compile.h should be updated too :)

But I am not sure the declaration of PyAST_XXX in compile.h can be moved to include/internal or not.
I checked several search results of PyAST_CompileEx in github.com and didn't find anybody calling this function directly.

Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't work, compile.h ends with a few API which are part of the limited C API:

/* These definitions must match corresponding definitions in graminit.h. */
#define Py_single_input 256
#define Py_file_input 257
#define Py_eval_input 258
#define Py_func_type_input 345

/* This doesn't need to match anything */
#define Py_fstring_input 800

If you want to move APIs excluded from the limited C API, you need to create Include/cpython/compile.h and include it from Include/compile.h.

@bedevere-bot
Copy link

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@shihai1991 shihai1991 changed the title bpo-35134: Move include/compile.h into include/cpython. bpo-35134: Move non-limited C API of include/compile.h into include/cpython. Mar 19, 2021
Include/cpython/compile.h Outdated Show resolved Hide resolved
Include/cpython/compile.h Outdated Show resolved Hide resolved
Include/cpython/compile.h Outdated Show resolved Hide resolved
Include/compile.h Outdated Show resolved Hide resolved
Include/compile.h Outdated Show resolved Hide resolved
Include/compile.h Outdated Show resolved Hide resolved
Include/compile.h Outdated Show resolved Hide resolved
@vstinner vstinner merged commit 56f031e into python:master Mar 22, 2021
@shihai1991
Copy link
Member Author

thanks, victor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants