[Web-SIG] Global Variables
tsoehnli at gmu.edu
Sat Sep 10 00:40:45 CEST 2005
I am working on an ongoing project, and recently merged all the different segments of the request into a single variable. To propogate that variable,across function calls, and imported modules, I had to pass it as a variable to each function. As is visible, this is a very redundant, and unnecessary action. I recently discovered that I could imbed the variable into __builtins__, and the variable is accessible throughout the entire request process. This seems to work so far when the request is in CGI mode and when the request is being handled by mod_python. I was wondering if anyone out there has dealt with this before, and knows whether or not there is an issue in using __builtins__ as a way of handling global variables, especially in respect to the way mod_python handles the use of variables. I have no desire for the variable to be overwritten, or redefined in the middle of a request.
I would rather be known as a Christian
and despised, than to be overlooked,
and thought of as one of the world.
More information about the Web-SIG