title: Check if a parameter is a Python module?
body: <p>How can I (pythonically) check if a parameter is a Python module? There's no type like module or package.</p>
  
  <pre><code>&gt;&gt;&gt; os
  &lt;module 'os' from '/usr/lib/python2.6/os.pyc'&gt;
  
  &gt;&gt;&gt; isinstance(os, module)
  Traceback (most recent call last):
    File "/usr/lib/gedit-2/plugins/pythonconsole/console.py", line 290, in __run
      r = eval(command, self.namespace, self.namespace)
    File "&lt;string&gt;", line 1, in &lt;module&gt;
  NameError: name 'module' is not defined
  </code></pre>
  
  <p>I can do this:</p>
  
  <pre><code>&gt;&gt;&gt; type(os)
  &lt;type 'module'&gt;    
  </code></pre>
  
  <p>But what do I compare it to? :(</p>
  
  <p>I've made a simple module to quickly find methods in modules and get help texts for them. I supply a module var and a string to my method:</p>
  
  <pre><code>def gethelp(module, sstring):
  
      # here i need to check if module is a module.
  
      for func in listseek(dir(module), sstring):
          help(module.__dict__[func])
  </code></pre>
  
  <p>Of course, this will work even if module = 'abc': then dir('abc') will give me the list of methods for string object, but I don't need that.</p>