Kamilche wrote: > Is there any reason NOT to do this that I may be unaware of? [snip] > # ----------- Module 2.py ------------ > # 'Self' module processing > import sys > var = 0 > self = sys.modules[__name__] > > def MyRoutine(): > self.var = 1 > > MyRoutine() > print var
Looks basically fine to me, but I'd probably write it as:: _self = __import__(__name__) Then you don't need to import sys. I'd also use a leading underscore for "self" so that it's clearly marked as a module-internal attribute. STeVe -- http://mail.python.org/mailman/listinfo/python-list