Closed gaborbernat closed 7 years ago
Hi! I must have forgotten to reply. astunparse
makes no effort to exactly replicate the original source, and triple-quoted strings are functionally no different from regular strings.
Hi, just finding this issue now. Is there any reason not to use ast.get_docstring
to check if the first item should be interpreted as a triple-quoted string? (p.s. happy to provide a PR)
The biggest reason it hasn't been done: astunparse
is meant to replicate as closely as possible what the Tools/parser/unparse.py
code in the official Python source is doing.
If this would be a trivial PR, feel free to go ahead. However, the project has had several edge case bugs due to diffs vs. the source, so I'm generally wary of straying far.
becomes