https://github.com/python/cpython/commit/4c9ac601d5b4faac5f55cea5ab148ad45f5831c8
commit: 4c9ac601d5b4faac5f55cea5ab148ad45f5831c8
branch: 3.15
author: Miss Islington (bot) <[email protected]>
committer: hugovk <[email protected]>
date: 2026-08-27T15:46:51+03:00
summary:

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

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