Skip to content

Commit

Permalink
[3.13] Clarify ast docs to use a less confusing example for `ast.Para…
Browse files Browse the repository at this point in the history
…mSpec` (pythonGH-127955) (python#127959)

Clarify ast docs to use a less confusing example for `ast.ParamSpec` (pythonGH-127955)

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

Co-authored-by: Steve C <[email protected]>
  • Loading branch information
miss-islington and diceroll123 authored Dec 15, 2024
1 parent 90ae4b6 commit 89f4b23
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Doc/library/ast.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1802,15 +1802,15 @@ 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(
name=Name(id='Alias', ctx=Store()),
type_params=[
ParamSpec(
name='P',
default_value=Tuple(
default_value=List(
elts=[
Name(id='int', ctx=Load()),
Name(id='str', ctx=Load())],
Expand Down

0 comments on commit 89f4b23

Please sign in to comment.