nonlocal fails ?

Richard Damon Richard at Damon-family.org
Thu Nov 14 12:53:35 EST 2019


> 
> On Nov 14, 2019, at 12:20 PM, R.Wieser <address at not.available> wrote:
> 
> MRAB,
> 
>> 'nonlocal' is used where the function is nested in another function
> 
> The problem is that that was not clear to me from the description - nor is 
> it logical to me why it exludes the main context from its use.
> 
> Regards,
> Rudy Wieser

Module ‘main’ content is already available via ‘global’, nonlocal was likely added later to get to enclosing function scope, which isn’t global, nor is it local.


More information about the Python-list mailing list