diff options
author | Guido van Rossum <guido@python.org> | 2006-08-28 15:27:34 +0000 |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2006-08-28 15:27:34 +0000 |
commit | 86e58e239e39845e706c4afa392423f0fedcdf39 (patch) | |
tree | 1d0f4d942e644ee5c903636d87176b98a7203371 /Lib/compiler/ast.py | |
parent | ecfd0b2f3bfd622c3ba148e53d3feebb8c1ae721 (diff) | |
download | cpython-git-86e58e239e39845e706c4afa392423f0fedcdf39.tar.gz |
SF patch 1547796 by Georg Brandl -- set literals.
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 |