How can I get a list of all classes within current module in Python?

I’ve seen plenty of examples of people extracting all of the classes from a module, usually something like: # foo.py class Foo: pass # test.py import inspect import foo for name, obj in inspect.getmembers(foo): if inspect.isclass(obj): print obj Awesome. But I can’t find out how to get all of the classes from the current module. … Read more