Traps should be set on signals, not conditions. decimal.Signals in the implementation is actually listing conditions. The attached patch brings the implementation into line with the spec & PEP 327. decimal.Signals is changed to list signals, not conditions. Context._raise_error is modified to handle signals properly. 19 tests fail in test_decimal.py, but I'm not sure how to fix it.
Logged In: YES user_id=7733 It's a start. The docs would also need changes to explain the difference between signals and conditions, and how to enable traps. A boolean "signal" attribute on exceptions may help. Set DecimalException.signal to False, set .signal on individual signal exceptions to True, and .signal on InvalidOperation subclasses to False.