def all_subclasses(cls):
 subclasses = cls.__subclasses__()
 for subcls in cls.__subclasses__():
  subclasses.extend(all_subclasses(subcls))
 return subclasses

def all_subclasses ( cls ) : subclasses = cls . __subclasses__ ( ) for subcls in cls . __subclasses__ ( ) : subclasses . extend ( all_subclasses ( subcls ) ) return subclasses
returns a list of *all* subclasses of cls .