We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Before running the symtable in compile.c there is an ast optimization phase that we should explore.
It seems to do some code folding of literal values.
see ast_opt.c
ast_opt.c
The text was updated successfully, but these errors were encountered:
python/cpython#2858 Problems with the c approach - they change the nodes inplace. We can't really do that. I mean we could - but it would be horrible
I couldn't find any in python 🤷♂️ but this discussion about the above PR points to these tests https://github.com/vstinner/fatoptimizer/blob/master/test_fatoptimizer.py
pypy has an interesting approach that allows for inplace mutation. I think we should try this approach https://github.com/mozillazg/pypy/blob/master/pypy/interpreter/astcompiler/optimize.py https://github.com/mozillazg/pypy/blob/522cfbedda554843fd989f1b1214e61b47fce0ab/pypy/interpreter/astcompiler/ast.py
That approach might also be nice for other places we do walk the node tree
Sorry, something went wrong.
No branches or pull requests
Before running the symtable in compile.c there is an ast optimization phase that we should explore.
It seems to do some code folding of literal values.
see
ast_opt.c
The text was updated successfully, but these errors were encountered: