]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Clarify ast docs to use a less confusing example for `ast.ParamSpec` (#127955)
authorSteve C <diceroll123@gmail.com>
Sun, 15 Dec 2024 12:28:43 +0000 (07:28 -0500)
committerGitHub <noreply@github.com>
Sun, 15 Dec 2024 12:28:43 +0000 (12:28 +0000)
Fix typo in ast docs: ParamSpec defaults

Doc/library/ast.rst

index 22d8c87cb58e78ac8447fe796acbf53deeef65ff..fd901e232855b549918aec351cc293de96e81a7f 100644 (file)
@@ -1807,7 +1807,7 @@ aliases.
 
    .. doctest::
 
-        >>> print(ast.dump(ast.parse("type Alias[**P = (int, str)] = Callable[P, int]"), indent=4))
+        >>> print(ast.dump(ast.parse("type Alias[**P = [int, str]] = Callable[P, int]"), indent=4))
         Module(
             body=[
                 TypeAlias(
@@ -1815,7 +1815,7 @@ aliases.
                     type_params=[
                         ParamSpec(
                             name='P',
-                            default_value=Tuple(
+                            default_value=List(
                                 elts=[
                                     Name(id='int', ctx=Load()),
                                     Name(id='str', ctx=Load())],