| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
The builtin compile() accepts an AST object since Python 2.6, but symtable.symtable() only accepted str and bytes, although the implementation builds the symbol table from an AST anyway. Accept an AST object as well: convert it for the requested compile type, validate it, honor future statements found in the tree, and build the symbol table the same way the compiler does. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Documentation build overview3 files changed ± library/symtable.html ± whatsnew/3.16.html ± whatsnew/changelog.html |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
The builtin compile() has accepted an AST object since Python 2.6, but symtable.symtable() only accepted str and bytes, although the implementation builds the symbol table from an AST anyway.
Accept an AST object as well: convert it for the requested compile type, validate it, honor future statements found in the tree, and build the symbol table the same way the compiler does. The result for an AST is identical to the result for the corresponding source string.
The module argument only affects warnings emitted by the parser, so it has no effect for AST input. Note that ast.parse() does not enforce the placement of future imports, but the symbol table construction does, matching compile() of an AST.
🤖 Generated with Claude Code