Class list of a module

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


Hi,

I want to get all classes of a module in a list. I wrote this code but I 
wonder
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))]

Regards,

Laurent Laffont 



More information about the Python-list mailing list