Re: [Python-Dev] Explicit Lexical Scoping (pre-PEP?)

2006-07-07 Thread Evan Simpson
Kevin Jacobs <[EMAIL PROTECTED]> wrote: > Why not extend the interface to the locals builtin and add a __getitem__ > that returns a proxy to access locals defined in other lexical scopes > via __{get/set/del}attr_: > > def counter(num): > num = 1 > def inc(): > locals[1].num += 1 >

Re: [Python-Dev] Explicit Lexical Scoping (pre-PEP?)

2006-07-06 Thread Evan Simpson
Talin wrote: > I propose to create a new type of scoping rule, which I will call > "explicit" lexical scoping, that will co-exist with the current > "implicit" scoping rule that exists in Python today. I'd like to toss one more variant into the mix. If we really need to address variables in an