Const
Factory object exposing one builder method per supported AST node type, offering a lighter-weight alternative to constructing raw node objects by hand. Every produced node defaults lineno to 1 and col_offset to 0.
lineno
1
col_offset
0
import { ast } from "py-ast";// Build `print("hi")`const call = ast.Call(ast.Name("print"), [ast.Constant("hi")]); Copy
import { ast } from "py-ast";// Build `print("hi")`const call = ast.Call(ast.Name("print"), [ast.Constant("hi")]);
Factory object exposing one builder method per supported AST node type, offering a lighter-weight alternative to constructing raw node objects by hand. Every produced node defaults
linenoto1andcol_offsetto0.