Class list of a module

Laurent.LAFFONT-ST at Laurent.LAFFONT-ST at
Mon Jan 15 08:27:30 CET 2007


I want to get all classes of a module in a list. I wrote this code but I 
if there's not a simpler solution

import inspect

def getClassList(aModule):
    return [getattr(aModule, attName) \
            for attName in aModule.__dict__  \
            if inspect.isclass(getattr(aModule, attName))]


Laurent Laffont 

More information about the Python-list mailing list