This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author levkivskyi
Recipients docs@python, gvanrossum, levkivskyi
Date 2016-09-07.14:08:38
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1473257318.94.0.500780981255.issue27999@psf.upfronthosting.co.za>
In-reply-to
Content
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

def f():
    x = 1
    global x

gives SyntaxWarning for several releases, maybe it is time to make it a SyntaxError?
History
Date User Action Args
2016-09-07 14:08:38levkivskyisetrecipients: + levkivskyi, gvanrossum, docs@python
2016-09-07 14:08:38levkivskyisetmessageid: <1473257318.94.0.500780981255.issue27999@psf.upfronthosting.co.za>
2016-09-07 14:08:38levkivskyilinkissue27999 messages
2016-09-07 14:08:38levkivskyicreate