def walktree(classes, children, parent):
 results = []
 classes.sort(key=attrgetter('__module__', '__name__'))
 for c in classes:
  results.append((c, c.__bases__))
  if (c in children):
   results.append(walktree(children[c], children, c))
 return results

def walktree ( classes , children , parent ) : results = [ ] classes . sort ( key = attrgetter ( '__module__' , '__name__' ) ) for c in classes : results . append ( ( c , c . __bases__ ) ) if ( c in children ) : results . append ( walktree ( children [ c ] , children , c ) ) return results
recursive helper function for getclasstree() .