diff options
Diffstat (limited to 'Lib/decimal.py')
-rw-r--r-- | Lib/decimal.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Lib/decimal.py b/Lib/decimal.py index b74ab01..746b34a 100644 --- a/Lib/decimal.py +++ b/Lib/decimal.py @@ -2596,7 +2596,7 @@ class Decimal(object): ans = ans._fix(context) return ans - def same_quantum(self, other): + def same_quantum(self, other, context=None): """Return True if self and other have the same exponent; otherwise return False. @@ -2914,7 +2914,7 @@ class Decimal(object): except TypeError: return 0 - def canonical(self, context=None): + def canonical(self): """Returns the same Decimal object. As we do not have different encodings for the same number, the @@ -2934,7 +2934,7 @@ class Decimal(object): return ans return self.compare(other, context=context) - def compare_total(self, other): + def compare_total(self, other, context=None): """Compares self to other using the abstract representations. This is not like the standard compare, which use their numerical @@ -3007,7 +3007,7 @@ class Decimal(object): return _Zero - def compare_total_mag(self, other): + def compare_total_mag(self, other, context=None): """Compares self to other using abstract repr., ignoring sign. Like compare_total, but with operand's sign ignored and assumed to be 0. @@ -3029,7 +3029,7 @@ class Decimal(object): else: return _dec_from_triple(1, self._int, self._exp, self._is_special) - def copy_sign(self, other): + def copy_sign(self, other, context=None): """Returns self with the sign of other.""" other = _convert_other(other, raiseit=True) return _dec_from_triple(other._sign, self._int, @@ -4182,7 +4182,7 @@ class Context(object): """ if not isinstance(a, Decimal): raise TypeError("canonical requires a Decimal as an argument.") - return a.canonical(context=self) + return a.canonical() def compare(self, a, b): """Compares values numerically. |