]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix example according to PEP 750 in "What's new in 3.14" (GH-134727)
authorVincent Poulailleau <vpoulailleau@gmail.com>
Mon, 23 Jun 2025 23:36:30 +0000 (01:36 +0200)
committerGitHub <noreply@github.com>
Mon, 23 Jun 2025 23:36:30 +0000 (19:36 -0400)
A redundant extra part was written. Added a closing tag, to match the usage in PEP 750.

Doc/whatsnew/3.14.rst

index f0a87a9ada7bab3ba53a966813f5f9371a6358c5..8b20e42d7d8e0758fa4c18c5af5ace4fe430af5b 100644 (file)
@@ -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