def _subtractAndCompareToZero(a, b, op):
        """Helper function for comparison operators.

        Subtracts b from a, exactly if possible, and compares the
        result with 0 using op, in such a way that the comparison
        won't recurse. If the difference raises a TypeError, returns
        NotImplemented instead.

        """
        if isinstance(b, numbers.Complex) and b.imag == 0:
            b = b.real
        if isinstance(b, float):
            b = a.from_float(b)
        try:
            # XXX: If b <: Real but not <: Rational, this is likely
            # to fall back to a float. If the actual values differ by
            # less than MIN_FLOAT, this could falsely call them equal,
            # which would make <= inconsistent with ==. Better ways of
            # doing this are welcome.
            diff = a - b
        except __HOLE__:
            return NotImplemented
        if isinstance(diff, Rational):
            return op(diff.numerator, 0)
        return op(diff, 0)
dataset/ETHPy150Open deanhiller/databus/webapp/play1.3.x/python/Lib/fractions.py/Fraction._subtractAndCompareToZero