er wrote:
>Simple question, I think: Is there a way to make a
>completely global variable across a slew of modules?
>If not, what is the canonical way to keep a global state?
>The purpose of this is to try to prevent circular module
>imports, which just sort of seems nasty. Thank you!
T
En Tue, 03 Feb 2009 17:10:18 -0200, er escribió:
It might be nice if Python could provide a global dictionary, perhaps
_G{},
where you can throw things. This is actually the solution provided by
the
Lua scripting language. Thanks for the global_ module solution, I was
just
making sure t
That was my hack for one other app, but I did it because I'd only been
studying Python for a month or two. Glad to see others did it once as well,
but that we all wised up. =P
It might be nice if Python could provide a global dictionary, perhaps _G{},
where you can throw things. This is actuall
Quoth MRAB :
> er wrote:
> > Simple question, I think: Is there a way to make a completely global
> > variable across a slew of modules? If not, what is the canonical
> > way to keep a global state? The purpose of this is to try to prevent
> > circular module imports, which just sort of seems nas
Gary Herron wrote:
er wrote:
Simple question, I think: Is there a way to make a completely global
variable across a slew of modules?
...
Create a module called, perhaps, global.py which contains your variables.
Bad choice of names (a reserved word). Use globals, or data or global_.
Othe
er wrote:
> Simple question, I think: Is there a way to make a completely global
> variable across a slew of modules?
No.
> If not, what is the canonical way to keep a global state?
But this might satisfy:
Create a module called, perhaps, global.py which contains your variables.
global.py
er wrote:
Simple question, I think: Is there a way to make a completely global
variable across a slew of modules? If not, what is the canonical
way to keep a global state? The purpose of this is to try to prevent
circular module imports, which just sort of seems nasty. Thank you!
Simple answ
Simple question, I think: Is there a way to make a completely global
variable across a slew of modules? If not, what is the canonical way to
keep a global state? The purpose of this is to try to prevent circular
module imports, which just sort of seems nasty. Thank you!
--
http://mail.python.org