-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
Closed
Labels
3.14bugs and security fixesbugs and security fixesstdlibPython modules in the Lib dirPython modules in the Lib dirtopic-typingtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
Bug description:
Currently t-strings are not recovered correctly in the STRING format in annotations:
>>> def f(x: t"a{int}"): pass
...
>>> import annotationlib
>>> annotationlib.get_annotations(f, format=annotationlib.Format.STRING)
{'x': "Template(strings=('a', ''), interpolations=(Interpolation(int, 'int', None, ''),))"}
I think we can do better there.
CPython versions tested on:
3.14
Operating systems tested on:
No response
Linked PRs
Metadata
Metadata
Assignees
Labels
3.14bugs and security fixesbugs and security fixesstdlibPython modules in the Lib dirPython modules in the Lib dirtopic-typingtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error