8000 Fix syntax error in an example in the ast documentation and sync docs… · python/cpython@c00c86b · GitHub
[go: up one dir, main page]

Skip to content

Commit c00c86b

Browse files
authored
Fix syntax error in an example in the ast documentation and sync docstrings (GH-18946)
1 parent 276a84a commit c00c86b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Doc/library/ast.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1704,7 +1704,7 @@ and classes for traversing abstract syntax trees:
17041704
value=Name(id='data', ctx=Load()),
17051705
slice=Constant(value=node.id),
17061706
ctx=node.ctx
1707-
), node)
1707+
)
17081708

17091709
Keep in mind that if the node you're operating on has child nodes you must
17101710
either transform the child nodes yourself or call the :meth:`generic_visit`

Lib/ast.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -443,11 +443,11 @@ class NodeTransformer(NodeVisitor):
443443
class RewriteName(NodeTransformer):
444444
445445
def visit_Name(self, node):
446-
return copy_location(Subscript(
446+
return Subscript(
447447
value=Name(id='data', ctx=Load()),
448448
slice=Constant(value=node.id),
449449
ctx=node.ctx
450-
), node)
450+
)
451451
452452
Keep in mind that if the node you're operating on has child nodes you must
453453
either transform the child nodes yourself or call the :meth:`generic_visit`

0 commit comments

Comments
 (0)
0