[3.9] bpo-28002: Roundtrip f-strings with ast.unparse better (GH-19612) by miss-islington · Pull Request #23430 · python/cpython (original) (raw)

By attempting to avoid backslashes in f-string expressions.
We also now proactively raise errors for some backslashes we can't
avoid while unparsing FormattedValues

Co-authored-by: hauntsaninja <>
Co-authored-by: Shantanu hauntsaninja@users.noreply.github.com
Co-authored-by: Batuhan Taskaya isidentical@gmail.com
(cherry picked from commit a993e90)

Co-authored-by: Shantanu 12621235+hauntsaninja@users.noreply.github.com

https://bugs.python.org/issue28002

Automerge-Triggered-By: GH:isidentical