Stefan Krah added the comment:
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".
----------
nosy: +skrah
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue19266>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com