diff options
author | Georg Brandl <georg@python.org> | 2009-01-03 21:17:04 +0000 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2009-01-03 21:17:04 +0000 |
commit | f957335164bb406f0f41f7dabeec1b9068d4b001 (patch) | |
tree | 9b53f692f0ad22fd003659c98f3220f752e7d2b5 /Doc/library/ast.rst | |
parent | 2fb16ec8e6cf085a9785d7af39f3c8b289edd587 (diff) | |
download | cpython-f957335164bb406f0f41f7dabeec1b9068d4b001.tar.gz |
Merged revisions 68219 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r68219 | georg.brandl | 2009-01-03 21:47:01 +0100 (Sat, 03 Jan 2009) | 2 lines
Fix uses of the default role.
........
Diffstat (limited to 'Doc/library/ast.rst')
-rw-r--r-- | Doc/library/ast.rst | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Doc/library/ast.rst b/Doc/library/ast.rst index 88c022876f..b8bc896688 100644 --- a/Doc/library/ast.rst +++ b/Doc/library/ast.rst @@ -178,7 +178,7 @@ and classes for traversing abstract syntax trees: A node visitor base class that walks the abstract syntax tree and calls a visitor function for every node found. This function may return a value - which is forwarded by the `visit` method. + which is forwarded by the :meth:`visit` method. This class is meant to be subclassed, with the subclass adding visitor methods. @@ -207,11 +207,11 @@ and classes for traversing abstract syntax trees: A :class:`NodeVisitor` subclass that walks the abstract syntax tree and allows modification of nodes. - The `NodeTransformer` will walk the AST and use the return value of the - visitor methods to replace or remove the old node. If the return value of - the visitor method is ``None``, the node will be removed from its location, - otherwise it is replaced with the return value. The return value may be the - original node in which case no replacement takes place. + The :class:`NodeTransformer` will walk the AST and use the return value of + the visitor methods to replace or remove the old node. If the return value + of the visitor method is ``None``, the node will be removed from its + location, otherwise it is replaced with the return value. The return value + may be the original node in which case no replacement takes place. Here is an example transformer that rewrites all occurrences of name lookups (``foo``) to ``data['foo']``:: |