I don't *like* boxing up my variables, but it still seems less offensive than a global statement and the resulting side effects.
How is that?
Devin
On Thu, Sep 29, 2011 at 4:24 PM, Jim Jewett
On Thu, Sep 29, 2011 at 3:03 PM, Eric Snow
wrote: The alternative is to leave nonlocal as just a simple statement, but change its behavior when the name is not found inside a containing function scope. Currently that is a syntax error.
Until this discussion started, I had not realized that nonlocal was limited to names from containing *function* scopes; I had thought that it would end up using the module-level globals if need be.
Having it indicate a scope *closer* than all the scopes where it already looked but failed to find the name seems wrong.
That said, my intuition may be suspect; outside examples, I have never used nonlocal, and work fairly hard to avoid global. I don't *like* boxing up my variables, but it still seems less offensive than a global statement and the resulting side effects.
-jJ _______________________________________________ Python-ideas mailing list Python-ideas@python.org http://mail.python.org/mailman/listinfo/python-ideas