symtable
symtable — Access to the compiler’s symbol tables
Source code: Lib/symtable.py
Symbol tables are generated by the compiler from AST just before bytecode is generated. The symbol table is responsible for calculating the scope of every identifier in the code. symtable
provides an interface to examine these tables.
1. Generating Symbol Tables
-
symtable.symtable(code, filename, compile_type)
-
Return the toplevel 登录查看完整内容