[Python-3000] Lexical variables at last!

2007-12-29 Thread Rocco Orlando Rossi
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!!

Re: [Python-3000] Lexical variables at last!

2007-12-29 Thread skip
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?

Re: [Python-3000] not switching core VCS (was How to override io.BytesIO and io.StringIO with their optimized C version?)

2007-12-29 Thread Blake Winton
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