summaryrefslogtreecommitdiffstats
path: root/Tools/compiler
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2006-12-28 06:47:50 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2006-12-28 06:47:50 (GMT)
commitc150536b5efadf71fcb4187cad7258be7268e157 (patch)
treeaeb17f5e0ecc6cc8ccdecb2b64e3f46a0a3af85c /Tools/compiler
parentf6657e67b3cf89649d14d9012b3964a3490d45b0 (diff)
downloadcpython-c150536b5efadf71fcb4187cad7258be7268e157.zip
cpython-c150536b5efadf71fcb4187cad7258be7268e157.tar.gz
cpython-c150536b5efadf71fcb4187cad7258be7268e157.tar.bz2
PEP 3107 - Function Annotations thanks to Tony Lownds
Diffstat (limited to 'Tools/compiler')
-rw-r--r--Tools/compiler/ast.txt10
-rw-r--r--Tools/compiler/astgen.py5
2 files changed, 11 insertions, 4 deletions
diff --git a/Tools/compiler/ast.txt b/Tools/compiler/ast.txt
index 2f62f55..2ff1223 100644
--- a/Tools/compiler/ast.txt
+++ b/Tools/compiler/ast.txt
@@ -12,8 +12,11 @@
Module: doc*, node
Stmt: nodes!
Decorators: nodes!
-Function: decorators&, name*, argnames*, defaults!, kwonlyargs*, flags*, doc*, code
-Lambda: argnames*, defaults!, kwonlyargs*, flags*, code
+Function: decorators&, name*, arguments!, defaults!, kwonlyargs!, returns&, flags*, doc*, code
+Lambda: arguments!, defaults!, kwonlyargs!, flags*, code
+SimpleArg: name*, annotation&
+NestedArgs: args!
+Kwarg: arg, expr
Class: name*, bases!, doc*, code
Pass:
Break:
@@ -93,9 +96,10 @@ init(Lambda):
self.varargs = 1
if flags & CO_VARKEYWORDS:
self.kwargs = 1
+ self.returns = None
init(GenExpr):
- self.argnames = ['.0']
+ self.arguments = [SimpleArg('.0', None)]
self.varargs = self.kwargs = None
self.kwonlyargs = ()
diff --git a/Tools/compiler/astgen.py b/Tools/compiler/astgen.py
index 26a185b..1485707 100644
--- a/Tools/compiler/astgen.py
+++ b/Tools/compiler/astgen.py
@@ -266,7 +266,10 @@ class Node:
pass # implemented by subclasses
class EmptyNode(Node):
- pass
+ def getChildNodes(self):
+ return ()
+ def getChildren(self):
+ return ()
class Expression(Node):
# Expression is an artificial node class to support "eval"