Visitar URL original
gh-105194: Fix format specifier escaped characters in f-strings by pablogsal · Pull Request #105231 · python/cpython · GitHub
Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixup! gh-105194: Fix format specifier escaped characters in f-strings
  • Loading branch information
pablogsal committed Jun 2, 2023
commit 9907c0fb9d2988142dee20487bed18a3e18053a5
2 changes: 2 additions & 0 deletions Lib/test/test_fstring.py
Original file line number Diff line number Diff line change
Expand Up @@ -771,6 +771,8 @@ def __format__(self, format_spec):

self.assertEqual(f'{CustomFormat():\n}', '\n')
self.assertEqual(f'{CustomFormat():\u2603}', '☃')
with self.assertWarns(SyntaxWarning):
exec('f"{F():¯\_(ツ)_/¯}"', {'F': CustomFormat})

def test_side_effect_order(self):
class X:
Expand Down