nonlocal fails ?

R.Wieser address at not.available
Thu Nov 14 12:11:36 EST 2019


Rhodri,

> MyVar is a global here, so nonlocal explicitly doesn't pick it up.

I do not agree with you there (the variable being global).  If it where than 
I would have been able to alter the variable inside the procedure without 
having to resort to a "global" override (an override which is only valid for 
the context its used in by the way, not anywhere else)

Than again, that is how it works in a few other languages, so I might have 
been poisonned by them. :-)

Regards,
Rudy Wieser




More information about the Python-list mailing list