• Home
  • Raw
  • Download

Lines Matching refs:traps

124 precision, rounding, or enabled traps::
129 capitals=1, flags=[], traps=[Overflow, DivisionByZero,
238 former is especially useful for debugging because many of the traps are
251 capitals=1, flags=[], traps=[])
276 capitals=1, flags=[Rounded, Inexact], traps=[])
282 Individual traps are set using the dictionary in the :attr:`traps` field of a
290 >>> getcontext().traps[DivisionByZero] = 1
355 malformed string. If the context traps :const:`InvalidOperation`, an exception
990 :const:`ROUND_HALF_UP`. All flags are cleared. All traps are enabled (treated
994 Because many of the traps are enabled, this context is useful for debugging.
1001 :const:`ROUND_HALF_EVEN`. All flags are cleared. No traps are enabled (so that
1004 Because the traps are disabled, this context is useful for applications that
1024 The default values are precision=28, rounding=ROUND_HALF_EVEN, and enabled traps
1031 .. class:: Context(prec=None, rounding=None, traps=None, flags=None, Emin=None, Emax=None, capitals…
1052 The *traps* and *flags* fields list any signals to be set. Generally, new
1053 contexts should only set traps and leave the flags clear.
1092 rounding method, flags, and traps are applied to the conversion.
1116 the context precision, rounding method, flags, and traps are applied to
1124 >>> context = Context(prec=5, traps=[Inexact])
1738 DefaultContext.traps = ExtendedContext.traps.copy()
1739 DefaultContext.traps[InvalidOperation] = 1
1929 >>> Decimal('3.21').quantize(TWOPLACES, context=Context(traps=[Inexact]))
1932 >>> Decimal('3.214').quantize(TWOPLACES, context=Context(traps=[Inexact]))