Class list of a module
bearophileHUGS at lycos.com
bearophileHUGS at lycos.com
Mon Jan 15 03:38:56 EST 2007
More information about the Python-list mailing list
Mon Jan 15 03:38:56 EST 2007
- Previous message (by thread): Class list of a module
- Next message (by thread): Class list of a module
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Gabriel Genellina: > >import inspect > def getClassList(aModule): > return [cls for cls in vars(aModule).itervalues() > if inspect.isclass(cls)] This is short enough too: from inspect import isclass getclasses = lambda module: filter(isclass, vars(module).itervalues()) Bye, bearophile
- Previous message (by thread): Class list of a module
- Next message (by thread): Class list of a module
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list