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

Class FloatComparisonOp

mypyc/ir/ops.py:1600–1628  ·  view source on GitHub ↗

Low-level comparison op for floats.

Source from the content-addressed store, hash-verified

1598
1599@final
1600class FloatComparisonOp(RegisterOp):
1601 """Low-level comparison op for floats."""
1602
1603 error_kind = ERR_NEVER
1604
1605 EQ: Final = 200
1606 NEQ: Final = 201
1607 LT: Final = 202
1608 GT: Final = 203
1609 LE: Final = 204
1610 GE: Final = 205
1611
1612 op_str: Final = {EQ: "==", NEQ: "!=", LT: "<", GT: ">", LE: "<=", GE: ">="}
1613
1614 def __init__(self, lhs: Value, rhs: Value, op: int, line: int = -1) -> None:
1615 super().__init__(line)
1616 self.type = bit_rprimitive
1617 self.lhs = lhs
1618 self.rhs = rhs
1619 self.op = op
1620
1621 def sources(self) -> list[Value]:
1622 return [self.lhs, self.rhs]
1623
1624 def set_sources(self, new: list[Value]) -> None:
1625 self.lhs, self.rhs = new
1626
1627 def accept(self, visitor: OpVisitor[T]) -> T:
1628 return visitor.visit_float_comparison_op(self)
1629
1630
1631# We can't have this in the FloatOp class body, because of

Callers 3

float_modMethod · 0.90
compare_floatsMethod · 0.90
is_same_float_signsMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…