Skip to content

Commit

Permalink
Add !r to spec on debug specifier. Closes #17
Browse files Browse the repository at this point in the history
  • Loading branch information
davepeck committed Nov 12, 2024
1 parent 70a1785 commit d6e1ea7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion peps/pep-0750.rst
Original file line number Diff line number Diff line change
Expand Up @@ -399,14 +399,15 @@ The debug specifier, ``=``, is supported in template strings and behaves similar
to how it behaves in f-strings, though due to limitations of the implementation
there is a slight difference.

In particular, ``t'{expr=}'`` is treated as ``t'expr={expr}'``:
In particular, ``t'{expr=}'`` is treated as ``t'expr={expr!r}'``:

.. code-block:: python
name = "World"
template = t"Hello {name=}"
assert template.args[0] == "Hello name="
assert template.args[1].value == "World"
assert template.args[1].conv == "r"
Raw Template Strings
Expand Down

0 comments on commit d6e1ea7

Please sign in to comment.