Getting a list of classes in the current module/auto introspection

Andy Leszczynski leszczynscy at nospamyahoo.com
Thu Apr 28 08:11:59 EDT 2005


Hi,
I have a following problem. Let's say there is a module which could be 
imported or run as __main__. It is going to contain hundreds of classes, 
something like that:

import moduleA
from moduleB import *

class A:
	pass

class B:
	pass

class C:
	pass

[...]


I would like to be able to get references (or names) of all of them but 
excluding stuff from moduleA and module B. Is there any pythonic/elegant 
way to do that?

Thanks, Andy



More information about the Python-list mailing list