Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32.4k
Closed
Description
compile()
(orast.parse()
, which calls it) can return the ast for some source code, converted to a Python object version of the AST. But this AST is not optimized (with_PyAST_Optimize
).
Static Python re-implemented_PyAST_Optimize
for this reason. If we expose a way for them to get an optimized AST, they won't have to.
For performance, it would be better not to call another API function on a Python AST, but to add an API option that runs_PyAST_Optimize
before converting the AST to Python.