(self, expr: OpExpr)
| 6171 | expr.node = n.node |
| 6172 | |
| 6173 | def visit_op_expr(self, expr: OpExpr) -> None: |
| 6174 | expr.left.accept(self) |
| 6175 | |
| 6176 | if expr.op in ("and", "or"): |
| 6177 | inferred = infer_condition_value(expr.left, self.options) |
| 6178 | if (inferred in (ALWAYS_FALSE, MYPY_FALSE) and expr.op == "and") or ( |
| 6179 | inferred in (ALWAYS_TRUE, MYPY_TRUE) and expr.op == "or" |
| 6180 | ): |
| 6181 | expr.right_unreachable = True |
| 6182 | return |
| 6183 | elif (inferred in (ALWAYS_TRUE, MYPY_TRUE) and expr.op == "and") or ( |
| 6184 | inferred in (ALWAYS_FALSE, MYPY_FALSE) and expr.op == "or" |
| 6185 | ): |
| 6186 | expr.right_always = True |
| 6187 | |
| 6188 | expr.right.accept(self) |
| 6189 | |
| 6190 | def visit_comparison_expr(self, expr: ComparisonExpr) -> None: |
| 6191 | for operand in expr.operands: |
nothing calls this directly
no test coverage detected