LibCST icon indicating copy to clipboard operation
LibCST copied to clipboard

Handle string escaping for SimpleString expression in FormattedString

Open jimmylai opened this issue 5 years ago • 1 comments

f"{a or ""}" this is invalid syntax but LibCST handles it and renders the invalid code.

We can either:

  • automatically escape the string quotes in the inner expression.
  • raise exception on code generation.

jimmylai avatar Jan 22 '20 16:01 jimmylai

We should raise an exception. We do not do any mangling of constructor arguments on any nodes elsewhere and shouldn't attempt to do so here.

DragonMinded avatar Jan 22 '20 21:01 DragonMinded