SF patch 1547796 by Georg Brandl -- set literals.

This commit is contained in:
Guido van Rossum 2006-08-28 15:27:34 +00:00
parent ecfd0b2f3b
commit 86e58e239e
22 changed files with 229 additions and 72 deletions

View file

@ -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