def inheritors(klass):
    """
    returns the inheritors of a class if it is loaded

    :return: a set of classes
    """
    subclasses = set()
    work = [klass]
    while work:
        parent = work.pop()
        for child in parent.__subclasses__():
            if child not in subclasses:
                subclasses.add(child)
                work.append(child)
    return subclasses
