From: Jeremy Hylton Date: Thu, 17 Feb 2000 22:06:20 +0000 (+0000) Subject: add varargs and kwargs flags to Lambda nodes X-Git-Tag: v1.6a1~399 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7708d697ee38f5d8c61b88737e941a4d1eb49691;p=thirdparty%2FPython%2Fcpython.git add varargs and kwargs flags to Lambda nodes --- diff --git a/Lib/compiler/ast.py b/Lib/compiler/ast.py index 7a7a6549c703..dfed562be614 100644 --- a/Lib/compiler/ast.py +++ b/Lib/compiler/ast.py @@ -105,6 +105,11 @@ class Lambda(Node): self.flags = flags self.code = code self._children = ('lambda', argnames, defaults, flags, code) + self.varargs = self.kwargs = None + if flags & CO_VARARGS: + self.varargs = 1 + if flags & CO_VARKEYWORDS: + self.kwargs = 1 def __repr__(self): return "Lambda(%s,%s,%s,%s)" % self._children[1:] diff --git a/Tools/compiler/compiler/ast.py b/Tools/compiler/compiler/ast.py index 7a7a6549c703..dfed562be614 100644 --- a/Tools/compiler/compiler/ast.py +++ b/Tools/compiler/compiler/ast.py @@ -105,6 +105,11 @@ class Lambda(Node): self.flags = flags self.code = code self._children = ('lambda', argnames, defaults, flags, code) + self.varargs = self.kwargs = None + if flags & CO_VARARGS: + self.varargs = 1 + if flags & CO_VARKEYWORDS: + self.kwargs = 1 def __repr__(self): return "Lambda(%s,%s,%s,%s)" % self._children[1:]