New submission from Stefan Krah <stefan-use...@bytereef.org>: I'm not sure if this is a documentation issue or a bug. If watchexp=0, quantize() also allows any number of digits:
>>> x = Decimal("6885998238912213556789006667970467609814") >>> y = Decimal("1e2") >>> x.quantize(y) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python3.2/decimal.py", line 2488, in quantize 'quantize result has too many digits for current context') File "/usr/local/lib/python3.2/decimal.py", line 3925, in _raise_error raise error(explanation) decimal.InvalidOperation: quantize result has too many digits for current context >>> >>> x.quantize(y, watchexp=0) Decimal('6.8859982389122135567890066679704676098E+39') ---------- components: Library (Lib) messages: 123603 nosy: mark.dickinson, rhettinger, skrah priority: normal severity: normal status: open title: decimal.py: quantize(): excess digits with watchexp=0 type: behavior versions: Python 2.7, Python 3.1, Python 3.2 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue10650> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com