MCPcopy Index your code
hub / github.com/python/mypy / visit_comparison_op

Method visit_comparison_op

mypyc/analysis/ircheck.py:452–463  ·  view source on GitHub ↗
(self, op: ComparisonOp)

Source from the content-addressed store, hash-verified

450 self.fail(op, f"Operand types have incompatible signs: {left}, {right}")
451
452 def visit_comparison_op(self, op: ComparisonOp) -> None:
453 self.check_compatibility(op, op.lhs.type, op.rhs.type)
454 self.expect_non_float(op, op.lhs)
455 self.expect_non_float(op, op.rhs)
456 left = op.lhs.type
457 right = op.rhs.type
458 if (
459 isinstance(left, RPrimitive)
460 and isinstance(right, RPrimitive)
461 and left.is_signed != right.is_signed
462 ):
463 self.fail(op, f"Operand types have incompatible signs: {left}, {right}")
464
465 def visit_float_op(self, op: FloatOp) -> None:
466 self.expect_float(op, op.lhs)

Callers

nothing calls this directly

Calls 4

check_compatibilityMethod · 0.95
expect_non_floatMethod · 0.95
failMethod · 0.95
isinstanceFunction · 0.85

Tested by

no test coverage detected