[Python-bugs-list] [ python-Bugs-416034 ] Confusing error message for top global
noreply@sourceforge.net
noreply@sourceforge.net
Fri, 13 Apr 2001 15:21:42 -0700
Bugs item #416034, was updated on 2001-04-13 15:21
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=416034&group_id=5470
Category: Parser/Compiler
Group: None
Status: Open
Priority: 7
Submitted By: Paul Prescod (prescod)
Assigned to: Jeremy Hylton (jhylton)
Summary: Confusing error message for top global
Initial Comment:
Call this test.py:
abc = 5
global abc
abc = 6
It is probably illegal to have a global at the top-
level but the error message prdocued is:
SyntaxWarning: name 'abc' is assigned to before global
declaration
That's technically true but the real problm is that
global statements should not be allowed outside of
functions.
----------------------------------------------------------------------
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=416034&group_id=5470