]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.14] Fix code example in `annotationlib` documentation (GH-136972) (#137002)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 22 Jul 2025 16:15:27 +0000 (18:15 +0200)
committerGitHub <noreply@github.com>
Tue, 22 Jul 2025 16:15:27 +0000 (19:15 +0300)
Co-authored-by: Victorien <65306057+Viicos@users.noreply.github.com>
Doc/library/annotationlib.rst

index 7dfc11449a6cbcc82396ace59fc0888bfaceb03f..981d89be7d58d68424e63233703586912000a072 100644 (file)
@@ -511,7 +511,7 @@ code execution even with no access to any globals or builtins. For example:
 
   >>> def f(x: (1).__class__.__base__.__subclasses__()[-1].__init__.__builtins__["print"]("Hello world")): pass
   ...
-  >>> annotationlib.get_annotations(f, format=annotationlib.Format.SOURCE)
+  >>> annotationlib.get_annotations(f, format=annotationlib.Format.STRING)
   Hello world
   {'x': 'None'}