'a == b'

def __eq__(a, b):

    if isinstance(b, numbers.Rational):
        return ((a._numerator == b.numerator) and (a._denominator == b.denominator))
    if (isinstance(b, numbers.Complex) and (b.imag == 0)):
        b = b.real
    if isinstance(b, float):
        if (math.isnan(b) or math.isinf(b)):
            return (0.0 == b)
        else:
            return (a == a.from_float(b))
    else:
        return NotImplemented
