[Python-3000-checkins] r51631 - in python/branches/p3yk: Doc/lib/libdis.tex Grammar/Grammar Include/Python-ast.h Include/graminit.h Include/opcode.h Lib/compiler/ast.py Lib/compiler/pyassem.py Lib/compiler/pycodegen.py Lib/compiler/transformer.py

Neal Norwitz nnorwitz at gmail.com
Tue Aug 29 08:07:47 CEST 2006


On 8/28/06, guido.van.rossum <python-3000-checkins at python.org> wrote:

> Modified: python/branches/p3yk/Lib/compiler/ast.py
> ==============================================================================
> --- python/branches/p3yk/Lib/compiler/ast.py    (original)
> +++ python/branches/p3yk/Lib/compiler/ast.py    Mon Aug 28 17:27:34 2006
> @@ -1091,6 +1089,22 @@
>      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)

Any reason to not use: return tuple(flatten_nodes(self.items)) ?

n


More information about the Python-3000-checkins mailing list