def _convert_for_comparison(self, other, equality_op=False):
 if isinstance(other, Decimal):
  return (self, other)
 if isinstance(other, _numbers.Rational):
  if (not self._is_special):
   self = _dec_from_triple(self._sign, str((int(self._int) * other.denominator)), self._exp)
  return (self, Decimal(other.numerator))
 if (equality_op and isinstance(other, _numbers.Complex) and (other.imag == 0)):
  other = other.real
 if isinstance(other, float):
  context = getcontext()
  if equality_op:
   context.flags[FloatOperation] = 1
  else:
   context._raise_error(FloatOperation, 'strict semantics for mixing floats and Decimals are enabled')
  return (self, Decimal.from_float(other))
 return (NotImplemented, NotImplemented)

def _convert_for_comparison ( self , other , equality_op = False ) : if isinstance ( other , Decimal ) : return ( self , other ) if isinstance ( other , _numbers . Rational ) : if ( not self . _is_special ) : self = _dec_from_triple ( self . _sign , str ( ( int ( self . _int ) * other . denominator ) ) , self . _exp ) return ( self , Decimal ( other . numerator ) ) if ( equality_op and isinstance ( other , _numbers . Complex ) and ( other . imag == 0 ) ) : other = other . real if isinstance ( other , float ) : context = getcontext ( ) if equality_op : context . flags [ FloatOperation ] = 1 else : context . _raise_error ( FloatOperation , 'strict semantics for mixing floats and Decimals are enabled' ) return ( self , Decimal . from_float ( other ) ) return ( NotImplemented , NotImplemented )
given a decimal instance self and a python object other .