Skip to content

Commit

Permalink
Clarify ast docs to use a less confusing example for ast.ParamSpec (G…
Browse files Browse the repository at this point in the history
…H-127955)

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

Co-authored-by: Steve C <[email protected]>
  • Loading branch information
diceroll123 authored and miss-islington committed Dec 15, 2024
1 parent 90ae4b6 commit 347acc6
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 347acc6

Please sign in to comment.