mirror of https://github.com/python/cpython.git
add varargs and kwargs flags to Lambda nodes
This commit is contained in:
parent
873bdc18e4
commit
7708d697ee
|
@ -105,6 +105,11 @@ def __init__(self, argnames, defaults, flags, code):
|
||||||
self.flags = flags
|
self.flags = flags
|
||||||
self.code = code
|
self.code = code
|
||||||
self._children = ('lambda', argnames, defaults, flags, 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):
|
def __repr__(self):
|
||||||
return "Lambda(%s,%s,%s,%s)" % self._children[1:]
|
return "Lambda(%s,%s,%s,%s)" % self._children[1:]
|
||||||
|
|
|
@ -105,6 +105,11 @@ def __init__(self, argnames, defaults, flags, code):
|
||||||
self.flags = flags
|
self.flags = flags
|
||||||
self.code = code
|
self.code = code
|
||||||
self._children = ('lambda', argnames, defaults, flags, 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):
|
def __repr__(self):
|
||||||
return "Lambda(%s,%s,%s,%s)" % self._children[1:]
|
return "Lambda(%s,%s,%s,%s)" % self._children[1:]
|
||||||
|
|
Loading…
Reference in New Issue