summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorEdward Loper <edloper@gradient.cis.upenn.edu>2004-09-28 02:53:50 (GMT)
committerEdward Loper <edloper@gradient.cis.upenn.edu>2004-09-28 02:53:50 (GMT)
commita7f62814cfc0043d695b1831e70537c739d86b14 (patch)
treeaf584b97c584d7ccc373895ae8cbccce577196a5 /Doc
parent87de0ca74131e9edf4c2816c7428c60af8dd2ea3 (diff)
downloadcpython-a7f62814cfc0043d695b1831e70537c739d86b14.zip
cpython-a7f62814cfc0043d695b1831e70537c739d86b14.tar.gz
cpython-a7f62814cfc0043d695b1831e70537c739d86b14.tar.bz2
Updated interactive examples in the "Examples" session to reflect the
fact that compiler.ast.Function now takes a "decorators" argument.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/lib/compiler.tex17
1 files changed, 10 insertions, 7 deletions
diff --git a/Doc/lib/compiler.tex b/Doc/lib/compiler.tex
index d75dad7e..79f0335 100644
--- a/Doc/lib/compiler.tex
+++ b/Doc/lib/compiler.tex
@@ -269,21 +269,24 @@ the class names from the \module{compiler.ast} module.
>>> mod = compiler.parseFile("/tmp/doublelib.py")
>>> mod
Module('This is an example module.\n\nThis is the docstring.\n',
- Stmt([Function('double', ['x'], [], 0, 'Return twice the argument',
- Stmt([Return(Mul((Name('x'), Const(2))))]))]))
+ Stmt([Function(None, 'double', ['x'], [], 0,
+ 'Return twice the argument',
+ Stmt([Return(Mul((Name('x'), Const(2))))]))]))
>>> from compiler.ast import *
>>> Module('This is an example module.\n\nThis is the docstring.\n',
-... Stmt([Function('double', ['x'], [], 0, 'Return twice the argument',
-... Stmt([Return(Mul((Name('x'), Const(2))))]))]))
+... Stmt([Function(None, 'double', ['x'], [], 0,
+... 'Return twice the argument',
+... Stmt([Return(Mul((Name('x'), Const(2))))]))]))
Module('This is an example module.\n\nThis is the docstring.\n',
- Stmt([Function('double', ['x'], [], 0, 'Return twice the argument',
- Stmt([Return(Mul((Name('x'), Const(2))))]))]))
+ Stmt([Function(None, 'double', ['x'], [], 0,
+ 'Return twice the argument',
+ Stmt([Return(Mul((Name('x'), Const(2))))]))]))
>>> mod.doc
'This is an example module.\n\nThis is the docstring.\n'
>>> for node in mod.node.nodes:
... print node
...
-Function('double', ['x'], [], 0, 'Return twice the argument',
+Function(None, 'double', ['x'], [], 0, 'Return twice the argument',
Stmt([Return(Mul((Name('x'), Const(2))))]))
>>> func = mod.node.nodes[0]
>>> func.code