Skip to content

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