Lines Matching refs:traps
129 precision, rounding, or enabled traps::
134 capitals=1, clamp=0, flags=[], traps=[Overflow, DivisionByZero,
168 >>> c.traps[FloatOperation] = True
272 former is especially useful for debugging because many of the traps are
285 capitals=1, clamp=0, flags=[], traps=[])
310 capitals=1, clamp=0, flags=[Inexact, Rounded], traps=[])
316 Individual traps are set using the dictionary in the :attr:`traps` field of a
324 >>> getcontext().traps[DivisionByZero] = 1
388 malformed string. If the context traps :const:`InvalidOperation`, an exception
953 :const:`ROUND_HALF_UP`. All flags are cleared. All traps are enabled (treated
957 Because many of the traps are enabled, this context is useful for debugging.
964 :const:`ROUND_HALF_EVEN`. All flags are cleared. No traps are enabled (so that
967 Because the traps are disabled, this context is useful for applications that
989 and enabled traps for :class:`Overflow`, :class:`InvalidOperation`, and
996 …(prec=None, rounding=None, Emin=None, Emax=None, capitals=None, clamp=None, flags=None, traps=None)
1008 The *traps* and *flags* fields list any signals to be set. Generally, new
1009 contexts should only set traps and leave the flags clear.
1054 Resets all of the traps to :const:`0`.
1070 rounding method, flags, and traps are applied to the conversion.
1094 the context precision, rounding method, flags, and traps are applied to
1102 >>> context = Context(prec=5, traps=[Inexact])
1810 DefaultContext.traps = ExtendedContext.traps.copy()
1811 DefaultContext.traps[InvalidOperation] = 1
2008 >>> Decimal('3.21').quantize(TWOPLACES, context=Context(traps=[Inexact]))
2011 >>> Decimal('3.214').quantize(TWOPLACES, context=Context(traps=[Inexact]))
2176 >>> c.traps[Inexact] = True