def is_subclass(o):
    return inspect.isclass(o) and issubclass(o, A)
print(inspect.getmembers(mymodule, predicate=is_subclass))
How to obtain all subclasses (of a specific class) defined by a module?