Lines Matching refs:traps
101 prec=9, rounding=ROUND_HALF_EVEN, traps=dict.fromkeys(Signals[m], 0)
370 self.context.traps[exception] = 1 #Catch these bugs...
372 self.context.traps[exception] = 0
386 self.context.traps[error] = 1
396 self.context.traps[error] = 0
406 self.context.traps[error] = 1
416 self.context.traps[error] = 0
421 self.context.traps[error] = 1
433 self.context.traps[error] = 0
563 c.traps[InvalidOperation] = True
754 nc.traps[InvalidOperation] = True
763 nc.traps[Rounded] = True
787 nc.traps[InvalidOperation] = False
1466 ctx.traps[InvalidOperation] = 1
1565 c3.traps[Underflow] = True
1570 cls.assertFalse(c2.traps[Underflow])
1579 cls.assertFalse(thiscontext.traps[Underflow])
2586 context = Context(prec=5, traps=[Inexact])
2806 capitals=None, clamp=None, flags=None, traps=None)
2852 self.assertEqual(c.traps, e.traps)
2874 traps=OrderedSignals[dumper][:ti]
2909 self.assertNotEqual(id(c.traps), id(d.traps))
3593 self.assertEqual(c1.traps, orig_ctx.traps)
3594 c1.traps[Clamped] = True
3601 self.assertEqual(c2.traps, new_ctx.traps)
3692 if context.traps[flag]:
3698 rounding=ROUND_HALF_EVEN, traps=[], flags=[])
3752 self.assertNotEqual(c.flags, c.traps)
3753 self.assertNotEqual(c.traps, c.flags)
3755 c.flags = c.traps
3756 self.assertEqual(c.flags, c.traps)
3757 self.assertEqual(c.traps, c.flags)
3760 c.traps = c.flags
3761 self.assertEqual(c.flags, c.traps)
3762 self.assertEqual(c.traps, c.flags)
3790 self.assertFalse(c.traps[FloatOperation])
3816 c.traps[FloatOperation] = True
3919 self.assertFalse(c.traps[FloatOperation])
3923 c.traps[FloatOperation] = True
3935 self.assertFalse(context.traps[FloatOperation])
3938 context.traps[Inexact] = True
3939 context.traps[FloatOperation] = True
3940 self.assertTrue(context.traps[FloatOperation])
3941 self.assertTrue(context.traps[Inexact])
4089 self.assertRaises(KeyError, Context, traps=["Q"])
4093 self.assertRaises(TypeError, Context, traps=(1,0))
4118 traps=None): argument
4136 if traps is not None:
4137 if isinstance(traps, list):
4138 traps = {v:(v in traps) for v in OrderedSignals[decimal] + traps}
4139 self.traps = traps
4202 c = MyContext(traps=[Rounded, DivisionByZero])
4204 self.assertTrue(c.traps[signal])
4207 self.assertFalse(c.traps[signal])
4276 c.traps[sig] = False
4379 c.traps[InvalidOperation] = False
4383 c.traps[InvalidOperation] = False
4399 c.traps[DivisionByZero] = False
4422 c.traps[Overflow] = False
4435 c.traps[InvalidOperation] = False
4567 c.traps = dict((s, 0) for s in OrderedSignals[P])
4705 c = Context(flags=C.DecClamped, traps=C.DecRounded)
4797 c.traps[sig] = True
4799 c.traps[FloatOperation] = True
4824 self.assertRaises(KeyError, c.traps.__setitem__, 801, 0)
4826 self.assertRaises(ValueError, c.traps.__delitem__, InvalidOperation)
5022 c.traps[InvalidOperation] = True
5078 c.traps[Inexact] = True
5125 c.traps[DivisionByZero] = True
5131 c.traps[InvalidOperation] = True
5136 c.traps[InvalidOperation] = True
5227 self.assertTrue(Overflow in c.traps)
5229 for k in c.traps.keys():
5230 c.traps[k] = True
5231 for v in c.traps.values():
5234 for k, v in c.traps.items():
5242 self.assertEqual(len(c.flags), len(c.traps))
5244 s = sys.getsizeof(c.traps)
5254 self.assertTrue(c.traps[InvalidOperation])
5264 d = c.traps.copy()
5266 c.traps = d
5267 assertIsExclusivelySet(Underflow, c.traps)
5292 traps = random.sample(OrderedSignals[C], t)
5301 traps=list(traps))
5316 for x in traps:
5328 assertIsExclusivelySet(InvalidOperation, c.traps)
5374 c.traps[InvalidOperation] = True
5400 c.traps[InvalidOperation] = True
5401 c.traps[Overflow] = True
5402 c.traps[Underflow] = True