[Python-Dev] fuzzy logic?

Fredrik Lundh fredrik@pythonware.com
Thu, 14 Dec 2000 14:19:08 +0100


here's a simple (but somewhat strange) test program:

def spam():
    a = 1
    if (0):
        global a
        print "global a"
    a = 2

def egg():
    b = 1
    if 0:
        global b
        print "global b"
    b = 2

egg()
spam()

print a
print b

if I run this under 1.5.2, I get:

    2
    Traceback (innermost last):
        File "<stdin>", line 19, in ?
    NameError: b

</F>