> Can an instance of a class in a module, in any simple way find out which > other classes that exists in said module ?
##### module x ########## class c1: pass class c2: pass ####################### Python 2.5 (r25:51908, Nov 1 2006, 11:42:37) [GCC 3.4.2 20041017 (Red Hat 3.4.2-6.fc3)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import types >>> import x >>> for i in dir(x): ... if type(getattr(x,i)) is types.ClassType: ... print "Hey, '%s' is a class!" % i ... Hey, 'c1' is a class! Hey, 'c2' is a class! >>> It might be not exactly what you want but maybe still helps. -- http://mail.python.org/mailman/listinfo/python-list