def get_classes(module, superclass=None):
 objects = [getattr(module, name) for name in dir(module) if (not name.startswith('_'))]
 classes = [obj for obj in objects if (isinstance(obj, type) and (obj.__module__ == module.__name__))]
 if (superclass is not None):
  classes = [cls for cls in classes if issubclass(cls, superclass)]
 return classes

def get_classes ( module , superclass = None ) : objects = [ getattr ( module , name ) for name in dir ( module ) if ( not name . startswith ( '_' ) ) ] classes = [ obj for obj in objects if ( isinstance ( obj , type ) and ( obj . __module__ == module . __name__ ) ) ] if ( superclass is not None ) : classes = [ cls for cls in classes if issubclass ( cls , superclass ) ] return classes
return a list of new-style classes defined in *module* .