Closes issue 27921: Disallow backslashes anywhere in f-strings. This is a temporary restriction. In 3.6 beta 2, the plan is to again allow backslashes in the string parts of f-strings, but disallow them in the expression parts.

This commit is contained in:
Eric V. Smith 2016-09-03 09:18:34 -04:00
parent 3b09cd64e0
commit 6a4efce7a5
6 changed files with 69 additions and 98 deletions

View file

@ -138,10 +138,6 @@ class UnparseTestCase(ASTTestCase):
# See issue 25180
self.check_roundtrip(r"""f'{f"{0}"*3}'""")
self.check_roundtrip(r"""f'{f"{y}"*3}'""")
self.check_roundtrip(r"""f'{f"{\'x\'}"*3}'""")
self.check_roundtrip(r'''f"{r'x' f'{\"s\"}'}"''')
self.check_roundtrip(r'''f"{r'x'rf'{\"s\"}'}"''')
def test_del_statement(self):
self.check_roundtrip("del x, y, z")