Skip to content

Commit 90ef017

Browse files
committed
Might like this best
1 parent b78f97a commit 90ef017

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

peps/pep-0750.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1308,14 +1308,14 @@ before the AST is created. It is therefore not possible to distinguish
13081308

13091309
.. code-block:: python
13101310
1311-
foo = 42
1312-
template1 = t"{foo=}"
1313-
template2 = t"foo={foo!r}"
1314-
assert template1.strings[0] == "foo="
1315-
assert template1.interpolations[0].expression == "foo"
1311+
value = 42
1312+
template1 = t"{value=}"
1313+
template2 = t"value={value!r}"
1314+
assert template1.strings[0] == "value="
1315+
assert template1.interpolations[0].expression == "value"
13161316
assert template1.interpolations[0].conversion == "r"
1317-
assert template2.strings[0] == "foo="
1318-
assert template2.interpolations[0].expression == "foo"
1317+
assert template2.strings[0] == "value="
1318+
assert template2.interpolations[0].expression == "value"
13191319
assert template2.interpolations[0].conversion == "r"
13201320
13211321
Finally, format specifiers in f-strings allow arbitrary nesting. In this PEP

0 commit comments

Comments
 (0)