[issue42889] Incorrect behavior after ast node visits
Xinmeng Xia
report at bugs.python.org
Fri Jan 15 22:31:05 EST 2021
Xinmeng Xia <xiaxm at smail.nju.edu.cn> added the comment:
Thank you for your kindly explanations! The output of the first program in msg384799 behaves as expected from the view of AST compiling. Yes,I see now. But for the second example in msg384879, the behaviors are inconsistent between old Python version(3.6,3.7,3.8) and new Python version(3.9,3.10). It is probably something wrong in "compile" parsing bool string, "False","True" in new version of Python(3.9,3.10).
I think a checker in function "compile" will not be complicated. Like you said, the simplest way I can think is to re-perform lexical analysis and syntax analysis. e.g. unparse ast, then parse ast before compiling AST object.
As for #42887, only part of attributes will lead to that bug. I think it's attribute-related. If that bug is triggered by c loop, all attributes should be involved.
----------
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42889>
_______________________________________
More information about the Python-bugs-list
mailing list