code: def walktree(classes, children, parent):
      
      results = []
      classes.sort(lambda a, b: cmp(a.__name__, b.__name__))
      for c in classes:
          results.append((c, c.__bases__))
          if children.has_key(c):
              results.append(walktree(children[c], children, c))
      return results
docs: Recursive helper function for getclasstree().