mirror of
https://github.com/python/cpython.git
synced 2025-07-07 19:35:27 +00:00
Fix example according to PEP 750 in "What's new in 3.14" (GH-134727)
A redundant extra part was written. Added a closing tag, to match the usage in PEP 750.
This commit is contained in:
parent
caad163b69
commit
2793b68f75
1 changed files with 1 additions and 1 deletions
|
@ -278,7 +278,7 @@ As another example, generating HTML attributes from data:
|
|||
|
||||
attributes = {"src": "shrubbery.jpg", "alt": "looks nice"}
|
||||
template = t"<img {attributes}>"
|
||||
assert html(template) == '<img src="shrubbery.jpg" alt="looks nice" class="looks-nice">'
|
||||
assert html(template) == '<img src="shrubbery.jpg" alt="looks nice" />'
|
||||
|
||||
Compared to using an f-string, the ``html`` function has access to template attributes
|
||||
containing the original information: static strings, interpolations, and values
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue