New submission from Nick Coghlan <ncogh...@gmail.com>: The language spec currently includes the following paragraph [1]:
Names listed in a global statement must not be defined as formal parameters or in a for loop control target, class definition, function definition, or import statement. While the first restriction is real (and enforced by CPython), since formal parameters are explicitly defined as local variables, there's no obvious rationale for the last 4 restrictions (and CPython doesn't enforce any of them). The proposal is that the paragraph be simplified to: Names listed in a global statement must not also be defined as formal function parameters. Attempting to do so raises SyntaxError. The current (incorrect!) CPython implementation detail note will be removed. A similar clarification will also be made in the "nonlocal" statement documentation. [1] http://docs.python.org/dev/reference/simple_stmts.html#the-global-statement ---------- messages: 158005 nosy: ncoghlan priority: normal severity: normal status: open title: Limit "global" keyword name conflicts in language spec to those enforced by CPython type: enhancement versions: Python 3.3 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue14544> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com