Lines Matching refs:traps
79 >>> getcontext().traps[DivisionByZero] = 1
87 >>> c.traps[InvalidOperation] = 0
92 >>> c.traps[InvalidOperation] = 1
107 >>> c.traps[InvalidOperation] = 0
421 # List of public traps and flags
445 ['prec', 'Emin', 'Emax', 'capitals', 'clamp', 'rounding', 'flags', 'traps']
2484 # create a copy of the current context, with cleared flags/traps
2488 newcontext.traps[exception] = 0
3889 traps - If traps[exception] = 1, then the exception is
3903 capitals=None, clamp=None, flags=None, traps=None,
3924 if traps is None:
3925 self.traps = dc.traps.copy()
3926 elif not isinstance(traps, dict):
3927 self.traps = dict((s, int(s in traps)) for s in _signals + traps)
3929 self.traps = traps
3980 elif name == 'flags' or name == 'traps':
3994 traps = [sig for sig, v in self.traps.items() if v]
3997 self.capitals, self.clamp, flags, traps))
4008 names = [t.__name__ for t, v in self.traps.items() if v]
4009 s.append('traps=[' + ', '.join(names) + ']')
4018 """Reset all traps to zero"""
4019 for flag in self.traps:
4020 self.traps[flag] = 0
4025 self.capitals, self.clamp, self.flags, self.traps,
4033 self.flags.copy(), self.traps.copy(),
4052 if not self.traps[error]:
4132 >>> context = Context(prec=5, traps=[Inexact])
6090 traps=[DivisionByZero, Overflow, InvalidOperation],
6105 traps=[DivisionByZero, Overflow, InvalidOperation, Clamped, Underflow],
6111 traps=[],