[Python-Dev] symtable module & globals

Peter Åstrand astrand at lysator.liu.se
Thu Feb 12 15:41:06 EST 2004

I've found the symtable module, which is quite nice. Unfortunately, I 
cannot find any documentation, and the module don't work as I expect:

If the source looks like this:

foo = 1

def fie():
    print foo

Calling is_global() for the "foo" name returns False (using the fie 
functions SymbolTable). 

With a method, is_global() returns true, though:

foo = 1

class C:
    def fie(self):
        print foo

Have I misunderstood something, or is this a bug?

/Peter Åstrand <astrand at lysator.liu.se>

More information about the Python-Dev mailing list