[New-bugs-announce] [issue4549] A defect in <The Python Tutorial>-<Python Scopes and Name Spaces> (Python3.0)
report at bugs.python.org
Fri Dec 5 17:31:14 CET 2008
New submission from ZX <tangshanqing at gmail.com>:
"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.
nosy: PyTiger, georg.brandl
title: A defect in <The Python Tutorial>-<Python Scopes and Name Spaces> (Python3.0)
versions: Python 3.0
Python tracker <report at bugs.python.org>
More information about the New-bugs-announce