diff options
author | Stefan Krah <skrah@bytereef.org> | 2012-12-15 21:36:49 (GMT) |
---|---|---|
committer | Stefan Krah <skrah@bytereef.org> | 2012-12-15 21:36:49 (GMT) |
commit | 8031d0dfd4c79509badaf960b3aba1dbdba94cbd (patch) | |
tree | 2c90c24cc941457a1852cca493b1006ed88d25bc /Lib/decimal.py | |
parent | 88a3e1f46b0262d0d03b1e6fb876c2bb9917e157 (diff) | |
parent | 040e3118267bda53b34e35470f7ef0f6dc40cfad (diff) | |
download | cpython-8031d0dfd4c79509badaf960b3aba1dbdba94cbd.zip cpython-8031d0dfd4c79509badaf960b3aba1dbdba94cbd.tar.gz cpython-8031d0dfd4c79509badaf960b3aba1dbdba94cbd.tar.bz2 |
Merge 3.3.
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 bb0c96e..25f8fbc 100644 --- a/Lib/decimal.py +++ b/Lib/decimal.py @@ -2594,7 +2594,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. @@ -2912,7 +2912,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 @@ -2932,7 +2932,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 @@ -3005,7 +3005,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. @@ -3027,7 +3027,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, @@ -4180,7 +4180,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. |