diff options
author | Jeremy Hylton <jeremy@alum.mit.edu> | 2000-02-08 18:57:32 (GMT) |
---|---|---|
committer | Jeremy Hylton <jeremy@alum.mit.edu> | 2000-02-08 18:57:32 (GMT) |
commit | 9605c11c4c3127e3b1749eb4f65b80e9e7db0d8e (patch) | |
tree | cb4fb3a9853065949523ad366f130449b3987142 /Lib/compiler/ast.py | |
parent | 69e2c6efbbeff44285f071d011e5e56f5fc26bad (diff) | |
download | cpython-9605c11c4c3127e3b1749eb4f65b80e9e7db0d8e.zip cpython-9605c11c4c3127e3b1749eb4f65b80e9e7db0d8e.tar.gz cpython-9605c11c4c3127e3b1749eb4f65b80e9e7db0d8e.tar.bz2 |
move constants out of transformer so that they can be shared with ast
add varargs and kwargs attributes to Function nodes
Diffstat (limited to 'Lib/compiler/ast.py')
-rw-r--r-- | Lib/compiler/ast.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/compiler/ast.py b/Lib/compiler/ast.py index 9c214d4..1715a7f 100644 --- a/Lib/compiler/ast.py +++ b/Lib/compiler/ast.py @@ -1,4 +1,5 @@ import types +from consts import CO_VARARGS, CO_VARKEYWORDS nodes = {} @@ -85,6 +86,12 @@ class Function(Node): self.code = code self._children = ('function', name, argnames, defaults, flags, doc, code) + self.varargs = self.kwargs = None + if flags & CO_VARARGS: + self.varargs = 1 + if flags & CO_VARKEYWORDS: + self.kwargs = 1 + def __repr__(self): return "Function(%s,%s,%s,%s,%s,%s)" % self._children[1:] |