From 4e0ce820586e93cfcefb16c2a3df8eaefc54cbca Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Wed, 7 Oct 2020 16:43:44 -0700 Subject: Revert "bpo-26680: Incorporate is_integer in all built-in and standard library numeric types (GH-6121)" (GH-22584) This reverts commit 58a7da9e125422323f79c4ee95ac5549989d8162. --- Lib/_pydecimal.py | 25 ------------------------- 1 file changed, 25 deletions(-) (limited to 'Lib/_pydecimal.py') diff --git a/Lib/_pydecimal.py b/Lib/_pydecimal.py index 8c0ef57092..ab989e5206 100644 --- a/Lib/_pydecimal.py +++ b/Lib/_pydecimal.py @@ -3164,12 +3164,6 @@ class Decimal(object): """Return True if self is a zero; otherwise return False.""" return not self._is_special and self._int == '0' - def is_integer(self): - """Return True is self is finite and integral; otherwise False.""" - if self._is_special: - return False - return self.to_integral_value(rounding=ROUND_FLOOR) == self - def _ln_exp_bound(self): """Compute a lower bound for the adjusted exponent of self.ln(). In other words, compute r such that self.ln() >= 10**r. Assumes @@ -4665,25 +4659,6 @@ class Context(object): a = _convert_other(a, raiseit=True) return a.is_zero() - def is_integer(self, a): - """Return True if the operand is integral; otherwise return False. - - >>> ExtendedContext.is_integer(Decimal('0')) - True - >>> ExtendedContext.is_integer(Decimal('2.50')) - False - >>> ExtendedContext.is_integer(Decimal('-0E+2')) - True - >>> ExtendedContext.is_integer(Decimal('-0.5')) - False - >>> ExtendedContext.is_integer(Decimal('NaN')) - False - >>> ExtendedContext.is_integer(10) - True - """ - a = _convert_other(a, raiseit=True) - return a.is_integer() - def ln(self, a): """Returns the natural (base e) logarithm of the operand. -- cgit v1.2.1