(lhs: "ExprWithOp", rhs: "ExprWithOp", op: Callable)
| 99 | |
| 100 | |
| 101 | def _binary_op_helper(lhs: "ExprWithOp", rhs: "ExprWithOp", op: Callable) -> "ExprWithOp": |
| 102 | if not isinstance(lhs, Expr): # type: ignore |
| 103 | raise ValueError("lhs must be Expr") |
| 104 | if isinstance(rhs, Expr): # type: ignore |
| 105 | return op(lhs, rhs) |
| 106 | elif isinstance(rhs, Number): |
| 107 | raise TypeError(f"Please convert {rhs} with `const` first") |
| 108 | else: |
| 109 | raise TypeError(f"type {type(rhs)} not supported") |
| 110 | |
| 111 | |
| 112 | def _binary_rhs_helper(rhs: "ExprWithOp") -> "ExprWithOp": |
no outgoing calls
no test coverage detected
searching dependent graphs…