'x.__hash__() <==> hash(x)'

def __hash__(self):

    if self._is_special:
        if self.is_snan():
            raise TypeError('Cannot    hash    a    signaling    NaN    value.')
        elif self.is_nan():
            return 0
        elif self._sign:
            return (-271828)
        else:
            return 314159
    self_as_float = float(self)
    if (Decimal.from_float(self_as_float) == self):
        return hash(self_as_float)
    if self._isinteger():
        op = _WorkRep(self.to_integral_value())
        return hash(((((-1) ** op.sign) * op.int) * pow(10, op.exp, ((2 ** 64) - 1))))
    return hash((self._sign, (self._exp + len(self._int)), self._int.rstrip('0')))
