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 facundobatista, mark.dickinson, rhettinger, skrah
Date 2010-05-04.14:53:58
SpamBayes Score 0.027213713
Marked as misclassified No
Message-id <1272984841.0.0.906657038884.issue8613@psf.upfronthosting.co.za>
In-reply-to
Content
In an effort to keep to one issue per tracker item, I'm pulling this issue out of the comments on issue 8567.

Issue:  if a Decimal operation raises several signals, and one or more of those signals is trapped, how should that operation affect flags?

Decimal currently ends up setting some or none of those flags, depending on exactly which signal is trapped first.

Stefan points out that cdecimal and decnumber both treat all operations as atomic:  *all* flags relevant to that operation are set, and only then are any traps acted on.

The specification isn't clear on this.  At http://speleotrove.com/decimal/daexcep.html it says:

"""The value of the trap-enabler for each signal in the context determines whether an operation is completed after the condition is detected or whether the condition is trapped and hence not necessarily completed (see IEEE 754 §7 and §8)."""

There's also this (thanks, Stefan), in http://speleotrove.com/decimal/damodel.html

"""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."""

However, this doesn't really help: do we regard signals as being raised one-by-one during (or at the end of) an operation, or all at once?  And should a trap take effect the moment a signal is handled, or should all traps be delayed until the end of an operation?
History
Date User Action Args
2010-05-04 14:54:01mark.dickinsonsetrecipients: + mark.dickinson, rhettinger, facundobatista, skrah
2010-05-04 14:54:01mark.dickinsonsetmessageid: <1272984841.0.0.906657038884.issue8613@psf.upfronthosting.co.za>
2010-05-04 14:53:59mark.dickinsonlinkissue8613 messages
2010-05-04 14:53:58mark.dickinsoncreate