[Python-ideas] Explicit variable capture list

Random832 random832 at fastmail.com
Tue Jan 19 23:44:00 EST 2016


Steven D'Aprano <steve at pearwood.info> writes:
> But neither of these approaches would be good for lambdas. I'm okay with 
> that -- lambda is a lightweight syntax, for lightweight needs. If your 
> needs are great (doc strings, annotations, multiple statements) don't 
> use lambda.

Yeah, but the fact that it's specifically part of C++'s lambda syntax
suggests that it is a very common thing to need with a lambda, doesn't
it? What about... lambda a, = b: [stuff with captured value b] ?



More information about the Python-ideas mailing list