mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
gh-112243: Don't include comments in f-string debug expressions (#112284)
This commit is contained in:
parent
3b3ec0d77f
commit
d59feb5dbe
3 changed files with 53 additions and 6 deletions
|
@ -1627,6 +1627,9 @@ x = (
|
|||
self.assertEqual(f'X{x = }Y', 'Xx = '+repr(x)+'Y')
|
||||
self.assertEqual(f"sadsd {1 + 1 = :{1 + 1:1d}f}", "sadsd 1 + 1 = 2.000000")
|
||||
|
||||
self.assertEqual(f"{1+2 = # my comment
|
||||
}", '1+2 = \n 3')
|
||||
|
||||
# These next lines contains tabs. Backslash escapes don't
|
||||
# work in f-strings.
|
||||
# patchcheck doesn't like these tabs. So the only way to test
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue