[Python-3000] replace globals() and global statement with global builtin object

Steven Bethard steven.bethard at gmail.com
Sat Jul 1 04:05:17 CEST 2006


BJörn Lindqvist wrote:
> I have often wanted something similar to that for global
> variables, instead of the global declaration:
>
> cache = None
> def init():
>     if not global.cache:
>         global.cache = init_cache()

Redirected since this seemed like a Python 3000 kind of request.  I
like the idea, particularly because it coincides well with my usual
uses for global/globals().  Seems like it might require some changes
in things like eval and exec that take locals and globals dicts, but I
don't know how much of a drawback that is.

Steve
-- 
I'm not *in*-sane. Indeed, I am so far *out* of sane that you appear a
tiny blip on the distant coast of sanity.
        --- Bucky Katt, Get Fuzzy


More information about the Python-3000 mailing list