[Python-3000] Lexical variables at last!

skip at pobox.com skip at pobox.com
Sat Dec 29 12:46:57 CET 2007


    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?

Lambdas only support a single expression, not statements and that's not
going to change in 3.0.

Skip


More information about the Python-3000 mailing list