[Python-Dev] Re: symtable module & globals

Peter Astrand astrand at lysator.liu.se
Mon Feb 16 16:15:27 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:

When I run my program, which uses the symtable module, on Python 2.3, I
get:

-:0: SyntaxWarning: import * only allowed at module level
-:0: SyntaxWarning: import * only allowed at module level
-:0: SyntaxWarning: import * only allowed at module level
-:0: SyntaxWarning: import * only allowed at module level

In a way this is not very surprising, since I call symtable with:

symtable.symtable(source, "foo", "exec")

This is a big problem for me, since I need to inspect symtables on a
module level. Would it be possible to make it possible for symtable to
operate in a module context? Or is it safe to ignore these warnings?


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







More information about the Python-Dev mailing list