global variables extended to other objects/modules

Jerry Sievers jerry at jerrysievers.com
Fri Apr 16 21:35:54 EDT 2004


KN <vald at dead.art.pl> writes:

> Hello, I'm new to this list, and I have an important
> question at the beginning.
> 
> There is a matter that concerns me - it's the globales
> implementation. I've read nearly everything I found 
> about this and about problems people were having with
> using it.

Another poster made several good and I would say "correct"
suggestions.

Here's another for you to consider.  At the risk of making your code
unreadable and possibly buggy;

Just "stick those pesky globals right down where you need em!

Suppose you have a module named A which imports B and B imports C...

>From A, it is possible to say B.C.var = something

This works but is a nasty hack that should be saved only for extreme
emergencies!

Peace



-- 
-------------------------------------------------------------------------------
Jerry Sievers   305 854-3001 (home)     WWW ECommerce Consultant
                305 321-1144 (mobile	http://www.JerrySievers.com/



More information about the Python-list mailing list