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 facundobatista, mark.dickinson, rhettinger, skrah
Date 2010-04-29.13:23:50
SpamBayes Score 0.0065936213
Marked as misclassified No
Message-id <1272547431.92.0.985648381868.issue8567@psf.upfronthosting.co.za>
In-reply-to
Content
Mark,

I'm very short of time today, so I hope I don't miss anything that you
wrote.

The model of decNumber (and libmpdec) is to accumulate any status
(flags) that occurs in a function, regardless of whether a signal
is trapped or not. 

Only at function exit the traps are checked. If multiple exceptions
could be raised, the order of precedence applies. All status that
has been accumulated in the function remains in the context.


This would be backed up by:

http://speleotrove.com/decimal/damodel.html

  ==>  flags and trap-enablers:

  ==> "For each of the signals, the corresponding flag is set to 1
       when the signal occurs. It is only reset to 0 by explicit
       user action."


So, in your example, in cdecimal I get:
>>> from cdecimal import *
>>> getcontext().traps[Inexact] = True
>>> Decimal('1e100').exp()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
cdecimal.Overflow: [<class 'cdecimal.Overflow'>, <class 'cdecimal.Inexact'>]


In the square brackets I list all signals that occurred _and_ are
trapped.





 

  "
History
Date User Action Args
2010-04-29 13:23:52skrahsetrecipients: + skrah, rhettinger, facundobatista, mark.dickinson
2010-04-29 13:23:51skrahsetmessageid: <1272547431.92.0.985648381868.issue8567@psf.upfronthosting.co.za>
2010-04-29 13:23:50skrahlinkissue8567 messages
2010-04-29 13:23:50skrahcreate