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

Skip to content

Commit 99ef1ac

Browse files
Fix syntax error in an example in the ast documentation and sync docstrings (GH-18946)
(cherry picked from commit c00c86b) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
1 parent 60b1b5a commit 99ef1ac

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
@@ -308,7 +308,7 @@ and classes for traversing abstract syntax trees:
308308
value=Name(id='data', ctx=Load()),
309309
slice=Index(value=Constant(value=node.id)),
310310
ctx=node.ctx
311-
), node)
311+
)
312312

313313
Keep in mind that if the node you're operating on has child nodes you must
314314
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
@@ -408,11 +408,11 @@ class NodeTransformer(NodeVisitor):
408408
class RewriteName(NodeTransformer):
409409
410410
def visit_Name(self, node):
411-
return copy_location(Subscript(
411+
return Subscript(
412412
value=Name(id='data', ctx=Load()),
413413
slice=Index(value=Str(s=node.id)),
414414
ctx=node.ctx
415-
), node)
415+
)
416416
417417
Keep in mind that if the node you're operating on has child nodes you must
418418
either transform the child nodes yourself or call the :meth:`generic_visit`

0 commit comments

Comments
 (0)
0