Anonymous user
Arithmetic evaluation: Difference between revisions
→ast standard library module: Lets modify the AST
m (→{{header|Python}}: ast standard library module) |
(→ast standard library module: Lets modify the AST) |
||
Line 1,781:
>>> code_object = compile(node, filename='<string>', mode='eval')
>>> eval(code_object)
14
>>> # lets modify the AST by changing the 5 to a 6
>>> node.body.right.right.n
5
>>> node.body.right.right.n = 6
>>> code_object = compile(node, filename='<string>', mode='eval')
>>> eval(code_object)
16</lang>
=={{header|Tcl}}==
|