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
avoid grammar issue
The referent is broken between the two parts on each side of the comma.
Also, «unlike» was used twice in this paragraph, but in different directions (t-strings are better than f-strings for structured processing / t-strings are nicer than other templates because similar to f-strings!)
Rewrite sligtly to avoid these two jarring effects
  • Loading branch information
merwok authored May 7, 2025
commit 0178dfbaef322c01623cc799b3252a5e71935c10
2 changes: 1 addition & 1 deletion Doc/whatsnew/3.14.rst
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ As another example, generating HTML attributes from data:
template = t"<img {attributes}>"
Comment thread
vstinner marked this conversation as resolved.
assert html(template) == '<img src="shrubbery.jpg" alt="looks nice" class="looks-nice">'

Unlike f-strings, the ``html`` function has access to template attributes
Compared to using an f-string, the ``html`` function has access to template attributes
containing the original information: static strings, interpolations, and values
from the original scope. Unlike existing templating approaches, t-strings build
from the well-known f-string syntax and rules. Template systems thus benefit
Expand Down