| 1038 | return res, pattern % (operand_expl,) |
| 1039 | |
| 1040 | def visit_BinOp(self, binop: ast.BinOp) -> tuple[ast.Name, str]: |
| 1041 | symbol = BINOP_MAP[binop.op.__class__] |
| 1042 | left_expr, left_expl = self.visit(binop.left) |
| 1043 | right_expr, right_expl = self.visit(binop.right) |
| 1044 | explanation = f"({left_expl} {symbol} {right_expl})" |
| 1045 | res = self.assign( |
| 1046 | ast.copy_location(ast.BinOp(left_expr, binop.op, right_expr), binop) |
| 1047 | ) |
| 1048 | return res, explanation |
| 1049 | |
| 1050 | def visit_Call(self, call: ast.Call) -> tuple[ast.Name, str]: |
| 1051 | new_func, func_expl = self.visit(call.func) |