Language and Compiler Modules
symtable
Exposes the compiler symbol tables used to classify names by scope. Inspect symbols for local, global, parameter and free-variable status without executing the source. This describes static binding rules, not values observed at runtime.
Formal Syntax & Structure
python syntaxpython
import symtableReturn Value
module
Module namespace available through import; import is a statement, not a value-returning expression.
Working Example
Example Snippetpython
import symtabletable = symtable.symtable("def f(x):\n return x + y\n", "demo.py", "exec")child = table.get_children()[0]print(child.lookup("x").is_parameter(), child.lookup("y").is_global())