Paul Hankin <[EMAIL PROTECTED]> writes: > def genDescendants(self): > return chain([self], *[child.genDescendants() > for child in self.children])
That is scary. It generates an in-memory list the size of the whole subtree, at every level. Total memory consumption is maybe even quadratic, depending on the tree shape, but even if it's only linear, it's way ugly. -- http://mail.python.org/mailman/listinfo/python-list