"Tian" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I want to create a object directory called Context in my program, which > is based on a dict to save and retrieve values/objects by string-type
I suspect that you would accomplish your goal much more easily by calling your module 'context' or something like that, importing it into every other module that needs it, and then accessing values as attributes of context. Don't reinvent the module ;-) other.py import context context.a = 3 x = context.b # where context.b is previous set somewhere else If you need multiple shared contexts, people subclass object class context(object): pass context1 = context() context2 = context() # now set and get attributes as needed Terry J. Reedy -- http://mail.python.org/mailman/listinfo/python-list