summaryrefslogtreecommitdiffstats
path: root/Lib/decimal.py
diff options
context:
space:
mode:
authorStefan Krah <skrah@bytereef.org>2014-04-30 17:15:38 (GMT)
committerStefan Krah <skrah@bytereef.org>2014-04-30 17:15:38 (GMT)
commitb151f8f60b3ea7199d4d98ec77f2e6fb03b8b7fb (patch)
tree7254b61d620d92178c03051cca8ad3cf715d55ad /Lib/decimal.py
parent5c2ac8c1c664d17924157ed769a7541c9228a1e3 (diff)
downloadcpython-b151f8f60b3ea7199d4d98ec77f2e6fb03b8b7fb.zip
cpython-b151f8f60b3ea7199d4d98ec77f2e6fb03b8b7fb.tar.gz
cpython-b151f8f60b3ea7199d4d98ec77f2e6fb03b8b7fb.tar.bz2
Issue #10650: Remove the non-standard 'watchexp' parameter from the
Decimal.quantize() method in the Python version. It had never been present in the C version.
Diffstat (limited to 'Lib/decimal.py')
-rw-r--r--Lib/decimal.py12
1 files changed, 1 insertions, 11 deletions
diff --git a/Lib/decimal.py b/Lib/decimal.py
index 5b98473..6d0b34c 100644
--- a/Lib/decimal.py
+++ b/Lib/decimal.py
@@ -2523,7 +2523,7 @@ class Decimal(object):
end -= 1
return _dec_from_triple(dup._sign, dup._int[:end], exp)
- def quantize(self, exp, rounding=None, context=None, watchexp=True):
+ def quantize(self, exp, rounding=None, context=None):
"""Quantize self so its exponent is the same as that of exp.
Similar to self._rescale(exp._exp) but with error checking.
@@ -2546,16 +2546,6 @@ class Decimal(object):
return context._raise_error(InvalidOperation,
'quantize with one INF')
- # if we're not watching exponents, do a simple rescale
- if not watchexp:
- ans = self._rescale(exp._exp, rounding)
- # raise Inexact and Rounded where appropriate
- if ans._exp > self._exp:
- context._raise_error(Rounded)
- if ans != self:
- context._raise_error(Inexact)
- return ans
-
# exp._exp should be between Etiny and Emax
if not (context.Etiny() <= exp._exp <= context.Emax):
return context._raise_error(InvalidOperation,