[Python-bugs-list] [ python-Bugs-233532 ] Add warning about undefined "global"

nobody nobody@sourceforge.net
Mon, 26 Feb 2001 21:20:26 -0800


Artifact #233532, was updated on 2001-02-21 18:02
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=233532&group_id=5470

Category: Parser/Compiler
Group: None
Status: Closed
Priority: 7
Submitted By: Tim Peters
Assigned to: Jeremy Hylton
Summary: Add warning about undefined "global"

Initial Comment:
The Ref Man has always said that "global" must not be used in some contexts, but that this was currently unenforced.  We should warn about this stuff in 2.1, so we can make it an error in a future release.

Example:

def f():
    g = 1
    global g

def f():
    print g
    global g


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

Comment By: Jeremy Hylton
Date: 2001-02-26 21:20

Message:
Logged In: YES 
user_id=31392

added in rev 2.173 of compile.c


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

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