]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix code example in `annotationlib` documentation (#136972)
authorVictorien <65306057+Viicos@users.noreply.github.com>
Tue, 22 Jul 2025 13:48:02 +0000 (15:48 +0200)
committerGitHub <noreply@github.com>
Tue, 22 Jul 2025 13:48:02 +0000 (13:48 +0000)
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'}