From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Mon, 23 Mar 2026 23:29:53 +0000 (+0100) Subject: [3.14] gh-145870: Fix Format.SOURCE reference in get_annotations docstring (GH-145889... X-Git-Tag: v3.14.4~78 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c1df96a930ac86797fbe0c42eb2b0b6299b89092;p=thirdparty%2FPython%2Fcpython.git [3.14] gh-145870: Fix Format.SOURCE reference in get_annotations docstring (GH-145889) (GH-146036) The get_annotations() docstring incorrectly referred to the SOURCE format, which was renamed to STRING during PEP 749 development. (cherry picked from commit 2a0fa500f82fc160feb726c0631f58c9a2f76796) Co-authored-by: wavebyrd <160968744+wavebyrd@users.noreply.github.com> Co-authored-by: Carson Jones --- diff --git a/Lib/annotationlib.py b/Lib/annotationlib.py index 832d160de7f4..df8fb5e4c620 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: