def scan_module(module, base_class):
    """Return all the items in a module that are subclass of a given base class.
    """
    missing = object()
    for name in module.__all__:
        component = getattr(module, name, missing)
        assert component is not missing, '{} has bad __all__: {}'.format(module
            , name)
        if issubclass(component, base_class):
            yield component
