Is there an elegant way to dir() module from inside?

davelist at mac.com davelist at mac.com
Thu Aug 24 10:37:25 EDT 2006


On Aug 24, 2006, at 10:18 AM, volcano wrote:

> I am looking for a way to discover which classes a module contains  
> from
> "inside". I am building a testing class that should, when  
> instatntiated
> within any module, locate certain classes within the containing  
> module.
> Words of wisdom? Anybody?


Check out the inspect module.

http://docs.python.org/lib/module-inspect.html

Dave




More information about the Python-list mailing list