Excuse me, does anyone know how to use Python AST to add parentheses to expressions like a == b in the code?
I have tried rewriting visit_Compare, but the delimit_if in ast.unparse automatically removes the parentheses I added because the precedence of a == b is higher.
New contributor
张代云轲 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1