nonlocal fails ?

Terry Reedy tjreedy at udel.edu
Fri Nov 15 16:06:46 EST 2019


On 11/15/2019 5:48 AM, R.Wieser wrote:

>> Closures are standard in functional languages and are less limited than
>> you seem to think.
> 
> I was talking about the "nonlocal" method of variable inheritance, not
> closures.
You cannot really separate the two.  A 'nonlocal' declaration can only 
be used in a nested function, and when you do, the function becomes a 
closure (a function with a '__closure__' attribute that is not None).


-- 
Terry Jan Reedy



More information about the Python-list mailing list