Python - Get class of type from imported module
<p>I am trying to import a class from a file with a dynamic name. Here is my file importer:</p>

<pre><code>def get_channel_module(app, method):
    mod_name = 'channel.%s.%s' % (app, method)
    module = __import__(mod_name, globals(), locals(), [method])
    return module
</code></pre>

<p>This imports the specific python file, for example, some_file.py, which looks like this:</p>

<pre><code>class SomeClassA(BaseClass):
    def __init__(self, *args, **kwargs):
        return

class SomeClassB():
    def __init__(self, *args, **kwargs):
        return
</code></pre>

<p>What I want to do is return only the class which extends BaseClass from the imported file, so in this instance, SomeClassA. Is there any way to do this? </p>
