[New-bugs-announce] [issue27999] Make "global after use" a SyntaxError
report at bugs.python.org
Wed Sep 7 10:08:38 EDT 2016
New submission from Ivan Levkivskyi:
The documentation at https://docs.python.org/3/reference/simple_stmts.html says that:
"Names listed in a global statement must not be used in the same code block textually preceding that global statement"
But then later:
"CPython implementation detail: The current implementation does not enforce the two restrictions,
but programs should not abuse this freedom, as future implementations may enforce them..."
Code like this
x = 1
gives SyntaxWarning for several releases, maybe it is time to make it a SyntaxError?
assignee: docs at python
components: Documentation, Interpreter Core
nosy: docs at python, gvanrossum, levkivskyi
title: Make "global after use" a SyntaxError
versions: Python 3.6
Python tracker <report at bugs.python.org>
More information about the New-bugs-announce