def _all_traverse(self):
 result = []
 result.append(self)
 for child in self.children:
  result.extend(child._all_traverse())
 return result

def _all_traverse ( self ) : result = [ ] result . append ( self ) for child in self . children : result . extend ( child . _all_traverse ( ) ) return result
version of node .