Xinmeng Xia <xi...@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 <rep...@bugs.python.org>
<https://bugs.python.org/issue42889>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to