Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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

Merged
vstinner merged 1 commit into
python:masterpython/cpython:masterfrom
vstinner:internal_compileCopy head branch name to clipboard
Mar 23, 2021
Merged

bpo-43244: Add pycore_compile.h header file#25000
vstinner merged 1 commit into
python:masterpython/cpython:masterfrom
vstinner:internal_compileCopy head branch name to clipboard

Conversation

@vstinner

@vstinner vstinner commented Mar 23, 2021

Copy link
Copy Markdown
Member

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
Copy Markdown
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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.