This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author skrah
Recipients docs@python, facundobatista, leewz, rhettinger, skrah, tim.peters
Date 2014-04-16.20:28:42
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <20140416202841.GA18310@sleipnir.bytereef.org>
In-reply-to <1397678610.97.0.368024294246.issue21227@psf.upfronthosting.co.za>
Content
Raymond Hettinger <report@bugs.python.org> wrote:
> > It is certainly possible to document DivisionImpossible etc.
> 
> This should not be done.  We've made strong efforts to not extend the Decimal Arithmetic Specification.

The exceptions are already there:

Python 2.7.3 (default, Mar 13 2014, 11:03:55)
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import decimal
>>> print(decimal.DivisionImpossible.__doc__)
Cannot perform the division adequately.

    This occurs and signals invalid-operation if the integer result of a
    divide-integer or remainder operation had too many digits (would be
    longer than precision).  The result is [0,qNaN].

The specification distinguishes between "conditions" and "signals". It is
true that the conditions are not technically raised, but they are very
much "subclasses" of InvalidOperation.

Cowlishaw himself makes the distinction between InvalidOperation
and IEEEInvalidOperation. The latter groups all conditions together:

#define DEC_IEEE_754_Invalid_operation (DEC_Conversion_syntax |     \
                                        DEC_Division_impossible |   \
                                        DEC_Division_undefined |    \
                                        DEC_Insufficient_storage |  \
                                        DEC_Invalid_context |       \
                                        DEC_Invalid_operation)

So while I don't particularly care whether we document the conditions or
not, I don't think doing so would extend the specification.
History
Date User Action Args
2014-04-16 20:28:42skrahsetrecipients: + skrah, tim.peters, rhettinger, facundobatista, docs@python, leewz
2014-04-16 20:28:42skrahlinkissue21227 messages
2014-04-16 20:28:42skrahcreate