Class list of a module

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Laurent.LAFFONT-ST@adixen.fr

    #1

    Class list of a module

    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(aM odule):
    return [getattr(aModule , attName) \
    for attName in aModule.__dict_ _ \
    if inspect.isclass (getattr(aModul e, attName))]

    Regards,

    Laurent Laffont
Working...