"Steven W. Orr" <[EMAIL PROTECTED]> writes: > ------------------><8------------------- const.py------------- > ... > sys.modules[__name__]=_const()
__name__ is 'const' since this file is const.py. So you've juset set the const module to actually be a const instance. > 1. Why do I not have to say > _const.pi = 3.14159 const.pi refers to item 'pi' in the const module, which you've set in sys.modules above. > 2. Can I make this behave in such a way that I can create my constants > with a classname that is different for different uses? e.g., > irrational_const.pi = 3.14159 Yes, irrational_const = _const() -- http://mail.python.org/mailman/listinfo/python-list