nonlocal fails ?

Jan Erik Moström lists at mostrom.pp.se
Thu Nov 14 09:58:26 EST 2019


On 14 Nov 2019, at 15:15, R.Wieser wrote:

> Too bad though, it means that procedures that want to share/use its 
> callers
> variables using nonlocal can never be called from main.  And that a 
> caller
> of a procedure using nonlocal cannot have the variable declared as 
> global
> (just tested it).

So what you want to do is dynamic scope? 
https://www.geeksforgeeks.org/static-and-dynamic-scoping/

= jem


More information about the Python-list mailing list