class foo1: '''something code''' class foo2: '''something code''' class foo3: '''something code''' import foo import inspect classes = map(lambda x:x[0],inspect.getmembers(foo,inspect.isclass)) print classes # => ['foo1','foo2','foo3'] inspect.getmembers(object)はobjectに登録されているオブジェクトの全メンバーを取得します。 形式は[(member1,type),(member2,type),....]といった形。 inspect.is--はそのオブジェクトが--に一致するかを判定するもので、 class, module, fu