[Tutor] Global Variable Gotcha

Tim Johnson tim@johnsons-web.com
Tue Jun 24 11:52:02 2003


Hi All:
    Example: I'm writting an application in python that
consists of one module. I have a global object that I
use in my code.

The module grows in size, and I then seperate some of
my code into another module. I now find that when I rerun
my reconfigured application that the code in my new namespace
no longer recognizes the global object. I then find that
I must rewrite code in the newly seperated functions so
that the global object is passed as a parameter. 

I'd welcome comments on how to avoid this, and also on
how to retain the 'visibility' of this object. I can
offer a code example if necessary.
 
   Pointers/URLs to docs welcome!

Thanks.
-- 
Tim Johnson <tim@johnsons-web.com>
      http://www.alaska-internet-solutions.com
      http://www.johnsons-web.com