I'm trying to write some code that will search all available Python modules (i.e. anything that could be imported) for any class that subclasses a known class (e.g. mypackage.MyClass). I thought I had something that worked using pkgutil.walk_packages() to walk the available packages, then using inspect.getmembers(...) to find classes, and finally issubclass(..., mypackage.MyClass) to find the classes I want - but I think this was importing every module and that was causing issues with conflicts and some other weird behaviours. Is there a way I can search for any subclass of my class, without importing those modules? Or only importing the modules that contain the subclass? This sounds to me like it should be easy, but I've not found a way yet... Continue reading...