]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-28002: Roundtrip f-strings with ast.unparse better (GH-19612) (GH-23430)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Fri, 20 Nov 2020 21:46:49 +0000 (13:46 -0800)
committerGitHub <noreply@github.com>
Fri, 20 Nov 2020 21:46:49 +0000 (00:46 +0300)
commit3763cc1dbdb930f67b443ceed7c44e4feb883b42
tree9ec6edf6d74b58a12fc1507812c5ebaaf9a7248d
parentf552f4b2d635ae031e154374ba3a609c63d09d2b
bpo-28002: Roundtrip f-strings with ast.unparse better (GH-19612) (GH-23430)

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 a993e901ebe60c38d46ecb31f771d0b4a206828c)

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
Lib/ast.py
Lib/test/test_unparse.py