I am trying to compile a DSL into python, and I found using this easier than manipulating string or doc myself. However, it is still very cumbersome with all those annotation flying around (when I construct the AST, I want anno to be ()).
Another problem is, there is an expr_literal field in Float/Int, and it is the field that guide the pretty print (instead of the literal value). so this make it harder to generate floating point literal in python.
I am trying to compile a DSL into python, and I found using this easier than manipulating string or doc myself. However, it is still very cumbersome with all those annotation flying around (when I construct the AST, I want anno to be ()). Another problem is, there is an expr_literal field in Float/Int, and it is the field that guide the pretty print (instead of the literal value). so this make it harder to generate floating point literal in python.