[New-bugs-announce] [issue4549] A defect in <The Python Tutorial>-<Python Scopes and Name Spaces> (Python3.0)

ZX 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.

----------
assignee: georg.brandl
components: Documentation
messages: 77036
nosy: PyTiger, georg.brandl
severity: normal
status: open
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>
<http://bugs.python.org/issue4549>
_______________________________________


More information about the New-bugs-announce mailing list