diff options
Diffstat (limited to 'Lib/compiler/ast.py')
| -rw-r--r-- | Lib/compiler/ast.py | 20 | 
1 files changed, 17 insertions, 3 deletions
diff --git a/Lib/compiler/ast.py b/Lib/compiler/ast.py index 94a6262d68..69533255d7 100644 --- a/Lib/compiler/ast.py +++ b/Lib/compiler/ast.py @@ -542,7 +542,6 @@ class Function(Node):              self.kwargs = 1 -      def getChildren(self):          children = []          children.append(self.decorators) @@ -572,6 +571,7 @@ class GenExpr(Node):          self.argnames = ['.0']          self.varargs = self.kwargs = None +      def getChildren(self):          return self.code, @@ -589,7 +589,6 @@ class GenExprFor(Node):          self.lineno = lineno          self.is_outmost = False -      def getChildren(self):          children = []          children.append(self.assign) @@ -766,7 +765,6 @@ class Lambda(Node):              self.kwargs = 1 -      def getChildren(self):          children = []          children.append(self.argnames) @@ -1091,6 +1089,22 @@ class RightShift(Node):      def __repr__(self):          return "RightShift((%s, %s))" % (repr(self.left), repr(self.right)) +class Set(Node): +    def __init__(self, items, lineno=None): +        self.items = items +        self.lineno = lineno + +    def getChildren(self): +        return tuple(flatten(self.items)) + +    def getChildNodes(self): +        nodelist = [] +        nodelist.extend(flatten_nodes(self.items)) +        return tuple(nodelist) + +    def __repr__(self): +        return "Set(%s)" % (repr(self.items),) +  class Slice(Node):      def __init__(self, expr, flags, lower, upper, lineno=None):          self.expr = expr  | 
