gh-153844: Support AST input in symtable.symtable() (GH-153845)
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>