title: List classes in directory (Python)
body: <p>I'm developing a Python 2.6 package in which I would like to fetch a list of all classes in a certain directory (within the package) in order to then perform introspection on the class objects.</p>
  
  <p>Specifically, if the directory containing the currently executing module has a sub-dir called 'foobar' and 'foobar' contains .py files specifying <code>class Foo(MyBase)</code>, <code>class Bar(MyBase)</code>, and <code>class Bar2</code>, I want to obtain a list of references to the class objects that inherit from <code>MyBase</code>, i.e. <code>Foo</code> and <code>Bar</code>, but not <code>Bar2</code>.</p>
  
  <p>I'm not sure if this task actually need involve any dealing with the filesystem or if the modules in the sub-dir are automatically loaded and just need to be listed via introspection somehow. Any ideas here please? Example code is much appreciated, since I'm pretty new to Python, in particular introspection.</p>