How to access a module's namespace within the module at import

Emile van Sebille emile at fenx.com
Tue Jan 15 18:32:07 EST 2002


"Rowland Smith" <rowland at webperformanceinc.com> wrote in message
news:3C44A60B.5050800 at webperformanceinc.com...
> I have a module that has a number of classes defined.  In the
module
> initialization code I want to look at the __dict__ of the
module and
> examine the classes that have been defined.
>

Does this help?

class A: pass

class B: pass

class C: pass

def module_init():
    for each in globals().keys():
        print each

module_init()



--

Emile van Sebille
emile at fenx.com

---------




More information about the Python-list mailing list