implement mpq.__hash__
mpz.__hash__
extend mpz.__cmp__