[ python-Bugs-889500 ] Line 0 SyntaxWarning with duplicate global declarations

SourceForge.net noreply at sourceforge.net
Mon Feb 2 23:39:34 EST 2004


Bugs item #889500, was opened at 2004-02-02 20:39
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=889500&group_id=5470

Category: Parser/Compiler
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Jeff Connelly (jeffconnelly)
Assigned to: Nobody/Anonymous (nobody)
Summary: Line 0 SyntaxWarning with duplicate global declarations

Initial Comment:
global a
a = "b"
global a

a.py:0: SyntaxWarning: name 'a' is assigned to before
global declaration


This is a fairly minor bug, however, the message is
misleading (the variable is in fact assigned to both
before and after the global declaration). At least, the
line number should be fixed to refer to the second
declaration, and if possible the error message should
be changed to "duplicate global declaration of 'a'".

P.S.: If "global a" is repeated multiple times, the
error message will be repeated, with the same line
number, and no indication that the warning refers to a
different line.



----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=889500&group_id=5470



More information about the Python-bugs-list mailing list