By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,768 Members | 2,054 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,768 IT Pros & Developers. It's quick & easy.

Class list of a module

P: n/a
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
Jan 15 '07 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.