def all_subclasses(cls):
    """Get all subclasses for a class recursevely."""
    return cls.__subclasses__() + [subcls for s in cls.__subclasses__()
                                   for subcls in all_subclasses(s)]