Skip to content

bpo-43244: Add pycore_compile.h header file #25000

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

Merged
merged 1 commit into from
Mar 23, 2021
Merged

bpo-43244: Add pycore_compile.h header file #25000

merged 1 commit into from
Mar 23, 2021

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Mar 23, 2021

Remove the compiler functions using "struct _mod" type, because the
public AST C API was removed:

  • PyAST_Compile()
  • PyAST_CompileEx()
  • PyAST_CompileObject()
  • PyFuture_FromAST()
  • PyFuture_FromASTObject()

These functions were undocumented and excluded from the limited C API.

Rename functions:

  • PyAST_CompileObject() => _PyAST_Compile()
  • PyFuture_FromASTObject() => _PyFuture_FromAST()

Moreover, _PyFuture_FromAST() is no longer exported (replace
PyAPI_FUNC() with extern). _PyAST_Compile() remains exported for
test_peg_generator.

Remove also compatibility functions:

  • PyAST_Compile()
  • PyAST_CompileEx()
  • PyFuture_FromAST()

https://bugs.python.org/issue43244

@vstinner
Copy link
Member Author

I checked if the removed functions are used by the top PyPI 4000 projects: there is only typed_ast, the same one that I met in PR #24933.

vstinner@apu$ ./search.sh PyAST_Compile
2021-02-18/graphene-federation-0.1.0.tar.gz
vstinner@apu$ ./search.sh PyAST_CompileEx
2021-02-18/graphene-federation-0.1.0.tar.gz
vstinner@apu$ ./search.sh PyAST_CompileObject
2021-02-18/graphene-federation-0.1.0.tar.gz
vstinner@apu$ ./search.sh PyFuture_FromASTObject
2021-02-18/graphene-federation-0.1.0.tar.gz
vstinner@apu$ ./search.sh PyFuture_FromAST
2021-02-18/typed_ast-1.4.2.tar.gz
2021-02-18/graphene-federation-0.1.0.tar.gz

graphene-federation-0.1.0.tar.gz contains a virtual environment which contains a Python binary (which contains the symbols). It can be safely ignored.

Remove the compiler functions using "struct _mod" type, because the
public AST C API was removed:

* PyAST_Compile()
* PyAST_CompileEx()
* PyAST_CompileObject()
* PyFuture_FromAST()
* PyFuture_FromASTObject()

These functions were undocumented and excluded from the limited C API.

Rename functions:

* PyAST_CompileObject() => _PyAST_Compile()
* PyFuture_FromASTObject() => _PyFuture_FromAST()

Moreover, _PyFuture_FromAST() is no longer exported (replace
PyAPI_FUNC() with extern). _PyAST_Compile() remains exported for
test_peg_generator.

Remove also compatibility functions:

* PyAST_Compile()
* PyAST_CompileEx()
* PyFuture_FromAST()
@vstinner vstinner merged commit a81fca6 into python:master Mar 23, 2021
@vstinner vstinner deleted the internal_compile branch March 23, 2021 23:51
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