Answering the main question without binding SQLALchemy or an elixir at all - yes, this is possible in Python.
The garbage collector ( gc ) module in the standard library has a function call that allows you to retrieve all references to this object, a wide interpreter. The class is always mentioned in the __mro__ attribute of any inherited classes.
Thus, the following function can retrieve all classes that inherit from this class:
import gc def find_subclasses(cls): all_refs = gc.get_referrers(cls) results = [] for obj in all_refs:
source share