[Python-ideas] Explicit variable capture list

Chris Angelico rosuav at gmail.com
Tue Jan 19 18:29:48 EST 2016


On Wed, Jan 20, 2016 at 3:47 AM, Guido van Rossum <guido at python.org> wrote:
> I think it's reasonable to divert this discussion to "value capture". Not
> sure if that's the usual terminology, but the idea should be that a
> reference to the value is captured, rather than (as Python normally does
> with closures) a reference to the variable (implemented as something called
> a "cell").

+1. This would permit deprecation of the "def blah(...., len=len):"
optimization - all you need to do is set a value capture on the name
"len".

ChrisA


More information about the Python-ideas mailing list