]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] Clarify ast docs to use a less confusing example for `ast.ParamSpec` (GH-12795...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sun, 15 Dec 2024 12:35:25 +0000 (13:35 +0100)
committerGitHub <noreply@github.com>
Sun, 15 Dec 2024 12:35:25 +0000 (12:35 +0000)
Clarify ast docs to use a less confusing example for `ast.ParamSpec` (GH-127955)

Fix typo in ast docs: ParamSpec defaults
(cherry picked from commit 7900a85019457c14e8c6abac532846bc9f26760d)

Co-authored-by: Steve C <diceroll123@gmail.com>
Doc/library/ast.rst

index bb126b790270d65a8a8d5e0cd2575531d5207593..ce261abc2a347d74a693868709ad1198fb8e071d 100644 (file)
@@ -1802,7 +1802,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(
@@ -1810,7 +1810,7 @@ aliases.
                     type_params=[
                         ParamSpec(
                             name='P',
-                            default_value=Tuple(
+                            default_value=List(
                                 elts=[
                                     Name(id='int', ctx=Load()),
                                     Name(id='str', ctx=Load())],