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 mark.dickinson
Recipients mark.dickinson, skrah
Date 2009-11-28.15:36:18
SpamBayes Score 3.1456574e-07
Marked as misclassified No
Message-id <1259422580.67.0.791900725863.issue7046@psf.upfronthosting.co.za>
In-reply-to
Content
I think it's actually easier for the user if we keep the exception type 
as it is, so that it's clear which flag it corresponds to.  This didn't 
occur to me until I looked at the section of the doctests (around line 
100 in decimal.py) that looks like:

>>> print c.divide(Decimal(0), Decimal(0))
Traceback (most recent call last):
  ...
  ...
  ...
InvalidOperation: 0 / 0
>>> print c.flags[InvalidOperation]
1

If the traceback specified 'DivisionUndefined' instead then the user has 
to figure out that the corresponding flag/trap is InvalidOperation.

Of course this could be worked around by giving a more detailed error 
message, e.g. DivisionUndefined: (InvalidOperation) 0/0, but this 
doesn't seem worth changing to me.
History
Date User Action Args
2009-11-28 15:36:20mark.dickinsonsetrecipients: + mark.dickinson, skrah
2009-11-28 15:36:20mark.dickinsonsetmessageid: <1259422580.67.0.791900725863.issue7046@psf.upfronthosting.co.za>
2009-11-28 15:36:19mark.dickinsonlinkissue7046 messages
2009-11-28 15:36:18mark.dickinsoncreate