def __eq__(self, other):
    if isinstance(other, fractions.Fraction):
        return ((self.num == other._numerator) and (self.den == other._denominator))
    else:
        return NotImplemented
def __eq__(self, other):
    if isinstance(other, fractions.Fraction):
        return ((self.num == other._numerator) and (self.den == other._denominator))
    else:
        return NotImplemented