Message200052
trap() is a bit ambiguous, since in floating point operations it
means that something is actually raised and not suppressed. So one
could write:
from decimal import *
c = getcontext()
c.traps[Inexact] = True
>>> Decimal(9) / 11 # raises now!
with trap(Inexact):
Decimal(9) / 11 # quiet!
As for "ignore" vs. "suppress", I'm with the people who think that they
are largely synonyms here. I find "ignore" slightly catchier and nicer
to read. Being pedantic, one could call it "ignore_once".
I would also like "catch", or pedantically, "catch_once". |
|
| Date |
User |
Action |
Args |
| 2013-10-16 10:18:46 | skrah | set | recipients:
+ skrah, barry, rhettinger, ncoghlan, vstinner, zero.piraeus |
| 2013-10-16 10:18:46 | skrah | set | messageid: <[email protected]> |
| 2013-10-16 10:18:46 | skrah | link | issue19266 messages |
| 2013-10-16 10:18:46 | skrah | create | |
|