def __hash__(s):
        a, b = s._mpq_
        if sys.version >= "3.2":
            inverse = pow(b, HASH_MODULUS-2, HASH_MODULUS)
            if not inverse:
                h = sys.hash_info.inf
            else:
                h = (abs(a) * inverse) % HASH_MODULUS
            if a < 0: h = -h
            if h == -1: h = -2
            return h
        else:
            if b == 1:
                return hash(a)
            # Power of two: mpf compatible hash
            if not (b & (b-1)):
                return mpf_hash(from_man_exp(a, bitcount(b)-1))
            return hash((a,b))
dataset/ETHPy150Open fredrik-johansson/mpmath/mpmath/rational.py/mpq.__hash__/swapped operands of `-`