title: Test if class is in module before importing the module
body: <p>Is it possible to test if a class is in a module before importing the module?</p>
  <p>Given <strong>root_package.sub_package.some_module.a_class</strong> I would like to see if <strong>some_module</strong> has an attribute <strong>a_class</strong> before attempting to import <strong>the module</strong> using importlib.</p>
  <p>I can write custom code to test for the <strong>a_class</strong> definition in the module source file but was hoping for standard library functionality to do this with.</p>