https://github.com/python/cpython/commit/767e6addf9a0338d43b5b1c3a05587c20192e59a
commit: 767e6addf9a0338d43b5b1c3a05587c20192e59a
branch: 3.14
author: Miss Islington (bot) <[email protected]>
committer: JelleZijlstra <[email protected]>
date: 2026-08-13T14:45:06Z
summary:

[3.14] gh-141174: Test `type_repr()` of `Template` with invalid syntax in 
`Interpolation` (GH-155661) (#155712)

gh-141174: Test `type_repr()` of `Template` with invalid syntax in 
`Interpolation` (GH-155661)

Test `type_repr()` of `Template` with invalid syntax in `Interpolation`
(cherry picked from commit 5cc9e466b02858d667fddb885b521ab2029c6e36)

Co-authored-by: dr-carlos <[email protected]>

files:
M Lib/test/test_annotationlib.py

diff --git a/Lib/test/test_annotationlib.py b/Lib/test/test_annotationlib.py
index 5bfcf5ce4131e3..eabdbdd59fb87b 100644
--- a/Lib/test/test_annotationlib.py
+++ b/Lib/test/test_annotationlib.py
@@ -1874,6 +1874,10 @@ def nested():
             type_repr(Template("hi", Interpolation(42, "   "))),
             "Template('hi', Interpolation(42, '   ', None, ''))",
         )
+        self.assertEqual(
+            type_repr(Template("hi", Interpolation(42, "4!2"))),
+            "Template('hi', Interpolation(42, '4!2', None, ''))",
+        )
         # gh138558: perhaps in the future, we can improve this behavior:
         self.assertEqual(type_repr(Template(Interpolation(42, "99"))), 
"t'{99}'")
 

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to