code: def walk_subclasses(root):
      
      classes = [root]
      visited = set()
      while classes:
          cls = classes.pop()
          if cls is type or cls in visited:
              continue
          classes.extend(cls.__subclasses__())
          visited.add(cls)
          if cls is not root:
              yield cls
docs: Does not yield the input class