def gen_all_subclasses(cls: Type) -> Generator[Type, None, None]:
    """
    Generates all subclasses of a class.

    Args:
        cls: a class

    Yields:
        all subclasses

    """

    for s1 in cls.__subclasses__():
        yield s1
        for s2 in gen_all_subclasses(s1):
            yield s2
def gen_all_subclasses ( cls : Type ) -> Generator [ Type , None , None ] : for s1 in cls . __subclasses__ ( ) : yield s1 for s2 in gen_all_subclasses ( s1 ) : yield s2
Generates all subclasses of a class.

    Args:
        cls: a class

    Yields:
        all subclasses