Finding all classes in a module

Jim Meier jim at dsdd.org
Fri Aug 9 08:43:55 CEST 2002


On Fri, 09 Aug 2002 00:15:07 -0600, Tom Harris wrote:

> If I import a module, how do I find the names of the class objects it
> contains?


import m

for k,v in m.__dict__:
	if isintance(v, types.ClassType):
		print k




More information about the Python-list mailing list