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

2006-06-30 Thread Steven Bethard
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

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

2006-06-30 Thread Guido van Rossum
On 6/30/06, Steven Bethard <[EMAIL PROTECTED]> wrote: > 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() > >

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

2006-06-30 Thread Steven Bethard
On 6/30/06, Guido van Rossum <[EMAIL PROTECTED]> wrote: > On 6/30/06, Steven Bethard <[EMAIL PROTECTED]> wrote: > > BJörn Lindqvist wrote: > > > I have often wanted something similar to that for global > > > variables, instead of the global declaration: > > > > > > cache = None > > > def init(): >

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

2006-06-30 Thread Guido van Rossum
On 6/30/06, Steven Bethard <[EMAIL PROTECTED]> wrote: > On 6/30/06, Guido van Rossum <[EMAIL PROTECTED]> wrote: > > On 6/30/06, Steven Bethard <[EMAIL PROTECTED]> wrote: > > > BJörn Lindqvist wrote: > > > > I have often wanted something similar to that for global > > > > variables, instead of the g