From 510af74053f605a8930f5328a9fdde2b1189e50e Mon Sep 17 00:00:00 2001 From: Carson Jones Date: Thu, 12 Mar 2026 18:14:07 -0400 Subject: [PATCH] gh-145870: Fix Format.SOURCE reference in get_annotations docstring The get_annotations() docstring incorrectly referred to the SOURCE format, which was renamed to STRING during PEP 749 development. --- Lib/annotationlib.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/annotationlib.py b/Lib/annotationlib.py index 832d160de7f4e5..df8fb5e4c62079 100644 --- a/Lib/annotationlib.py +++ b/Lib/annotationlib.py @@ -919,7 +919,7 @@ def get_annotations( does not exist, the __annotate__ function is called. The FORWARDREF format uses __annotations__ if it exists and can be evaluated, and otherwise falls back to calling the __annotate__ function. - The SOURCE format tries __annotate__ first, and falls back to + The STRING format tries __annotate__ first, and falls back to using __annotations__, stringified using annotations_to_string(). This function handles several details for you: