Message77036
"If a name is declared global, then all references and assignments go
directly to the middle scope containing the module’s global names.
Otherwise, all variables found outside of the innermost scope are
read-only (an attempt to write to such a variable will simply create a
new local variable in the innermost scope, leaving the identically named
outer variable unchanged)." ___excerpt from <The Python
Tutorial>-<Classes>-<Python Scopes and Name Spaces>
The above description is correct in Python 2.X.
Since 3.X introduced the "nonlocal" keyword, I think the above
description is obsolete, need to be upgraded. |
|
Date |
User |
Action |
Args |
2008-12-05 16:31:14 | PyTiger | set | recipients:
+ PyTiger, georg.brandl |
2008-12-05 16:31:14 | PyTiger | set | messageid: <1228494674.65.0.590088285872.issue4549@psf.upfronthosting.co.za> |
2008-12-05 16:31:13 | PyTiger | link | issue4549 messages |
2008-12-05 16:31:12 | PyTiger | create | |
|