def _list_subclasses(cls):
    """
    Recursively lists all subclasses of `cls`.
    """
    subclasses = cls.__subclasses__()

    for subclass in cls.__subclasses__():
        subclasses += _list_subclasses(subclass)

    return subclasses