Python AST, Codegen & Source Transformation

Parent: Programming Languages · researched 2026-06-02T18:13:44.156Z· 5 sources · 7 concepts · skill python-ast-codegen

Children

Frontier under this node: AST is lossy -> when you need a CST, Code generation (ast.unparse, astor/astunparse, compile+exec, string templating tradeoff), Import hooks (sys.meta_path finders/loaders, source_to_code, PEP 302/451), LibCST (lossless CST, matchers, metadata, codemod framework, 3.0-3.14), Pitfalls (AST version drift, locations, exec/eval/pickle security, round-trip loss), Use cases (linters/formatters, codemods, instrumentation, DSLs/PEP 750), ast module (parse, NodeVisitor/NodeTransformer, fix_missing_locations, compile, unparse 3.9+, literal_eval)

← the whole tree · 3D view· how to read this page