[Python-checkins] python/dist/src/Doc/lib compiler.tex,1.4,1.5
edloper at users.sourceforge.net
edloper at users.sourceforge.net
Tue Sep 28 04:53:52 CEST 2004
Update of /cvsroot/python/python/dist/src/Doc/lib
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15678/dist/src/Doc/lib
Modified Files:
compiler.tex
Log Message:
Updated interactive examples in the "Examples" session to reflect the
fact that compiler.ast.Function now takes a "decorators" argument.
Index: compiler.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/compiler.tex,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- compiler.tex 30 Oct 2003 05:42:15 -0000 1.4
+++ compiler.tex 28 Sep 2004 02:53:50 -0000 1.5
@@ -269,21 +269,24 @@
>>> 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
More information about the Python-checkins
mailing list