From 9a4135e939bc223f592045a38e0f927ba170da32 Mon Sep 17 00:00:00 2001 From: "Eric V. Smith" Date: Wed, 8 May 2019 16:28:48 -0400 Subject: bpo-36817: Add f-string debugging using '='. (GH-13123) If a "=" is specified a the end of an f-string expression, the f-string will evaluate to the text of the expression, followed by '=', followed by the repr of the value of the expression. --- Lib/test/test_future.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'Lib/test/test_future.py') diff --git a/Lib/test/test_future.py b/Lib/test/test_future.py index c60a016f01..38de3dfdaf 100644 --- a/Lib/test/test_future.py +++ b/Lib/test/test_future.py @@ -255,6 +255,15 @@ class AnnotationsFutureTestCase(unittest.TestCase): eq("f'space between opening braces: { {a for a in (1, 2, 3)}}'") eq("f'{(lambda x: x)}'") eq("f'{(None if a else lambda x: x)}'") + eq("f'{x}'") + eq("f'{x!r}'") + eq("f'{x!a}'") + eq("f'{x=!r}'") + eq("f'{x=:}'") + eq("f'{x=:.2f}'") + eq("f'{x=!r}'") + eq("f'{x=!a}'") + eq("f'{x=!s:*^20}'") eq('(yield from outside_of_generator)') eq('(yield)') eq('(yield a + b)') -- cgit v1.2.1