globals accros modules

Gabriel Genellina gagsl-py at
Thu Jan 11 06:15:31 CET 2007

At Thursday 11/1/2007 01:11, alf wrote:

>How can I have global globals without cyclical import?

You can't. Globals are module globals. You need to qualify *which* 
module `a` belongs to.

>def f():
>      global a
>      print a
>import amodule

Change a=1 to amodule.a=1
If you find yourself doing tricks with the module globals, think 
about redesigning your application.

Gabriel Genellina
Softlab SRL 


Preguntá. Respondé. Descubrí. 
Todo lo que querías saber, y lo que ni imaginabas, 
está en Yahoo! Respuestas (Beta). 
¡Probalo ya! 

More information about the Python-list mailing list