I think it's wonderful that Python 3000 will have the nonlocal keyword
allowing complete lexical closures. I've just downloaded Python 3.0 a2 and
tried the following code:
def accumulator(n):
def foo(x):
nonlocal n
n = n + x
return n
return foo
... and it works!!
Rocco> However, I've also tried this:
Rocco> def accumulator(n):
Rocco> return lambda x: nonlocal n = n + x
Rocco> and unfortunately it gave me a syntax error. I don't see any
Rocco> reason why this kind of code should not be possible.
Rocco> What do you all think?
Barry Warsaw wrote:
> On Dec 28, 2007, at 8:24 PM, Martin v. Löwis wrote:
>>> We'll leave the timing up to Brett and the infrastructure committee,
>>> but IMO, there's no overriding reason to wait.
>> *That* is the major overriding reason: lack of volunteers.
> If Bazaar is chosen, I would voluntee