]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.14] gh-119180: annotationlib: Fix values of Format members in docs (GH-133841...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sun, 11 May 2025 15:49:21 +0000 (17:49 +0200)
committerGitHub <noreply@github.com>
Sun, 11 May 2025 15:49:21 +0000 (15:49 +0000)
gh-119180: annotationlib: Fix values of Format members in docs (GH-133841)
(cherry picked from commit 0eb448cae5e9008f815204d8b46bfd7cd641a152)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Doc/library/annotationlib.rst

index a96f5167c02613a06065afc5ce1ed01a2f2cc37e..41c9ce479ff0f8d068fbf024550a6e54dd439edf 100644 (file)
@@ -127,16 +127,27 @@ Classes
 
       Values are the result of evaluating the annotation expressions.
 
-   .. attribute:: FORWARDREF
+   .. attribute:: VALUE_WITH_FAKE_GLOBALS
       :value: 2
 
+      Special value used to signal that an annotate function is being
+      evaluated in a special environment with fake globals. When passed this
+      value, annotate functions should either return the same value as for
+      the :attr:`Format.VALUE` format, or raise :exc:`NotImplementedError`
+      to signal that they do not support execution in this environment.
+      This format is only used internally and should not be passed to
+      the functions in this module.
+
+   .. attribute:: FORWARDREF
+      :value: 3
+
       Values are real annotation values (as per :attr:`Format.VALUE` format)
       for defined values, and :class:`ForwardRef` proxies for undefined
       values. Real objects may contain references to :class:`ForwardRef`
       proxy objects.
 
    .. attribute:: STRING
-      :value: 3
+      :value: 4
 
       Values are the text string of the annotation as it appears in the
       source code, up to modifications including, but not restricted to,
@@ -144,17 +155,6 @@ Classes
 
       The exact values of these strings may change in future versions of Python.
 
-   .. attribute:: VALUE_WITH_FAKE_GLOBALS
-      :value: 4
-
-      Special value used to signal that an annotate function is being
-      evaluated in a special environment with fake globals. When passed this
-      value, annotate functions should either return the same value as for
-      the :attr:`Format.VALUE` format, or raise :exc:`NotImplementedError`
-      to signal that they do not support execution in this environment.
-      This format is only used internally and should not be passed to
-      the functions in this module.
-
    .. versionadded:: 3.14
 
 .. class:: ForwardRef