A TestSet contains the original input operands, converted operands, Python exceptions that occurred either during conversion or during execution of the actual function, and the final results. For safety, most attributes are lists that only support the append operation.
| 339 | __mul__ = __reversed__ = __rmul__ = __setattr__ = __setitem__ = unsupported |
| 340 | |
| 341 | class TestSet(object): |
| 342 | """A TestSet contains the original input operands, converted operands, |
| 343 | Python exceptions that occurred either during conversion or during |
| 344 | execution of the actual function, and the final results. |
| 345 | |
| 346 | For safety, most attributes are lists that only support the append |
| 347 | operation. |
| 348 | |
| 349 | If a function name is prefixed with 'context.', the corresponding |
| 350 | context method is called. |
| 351 | """ |
| 352 | def __init__(self, funcname, operands): |
| 353 | if funcname.startswith("context."): |
| 354 | self.funcname = funcname.replace("context.", "") |
| 355 | self.contextfunc = True |
| 356 | else: |
| 357 | self.funcname = funcname |
| 358 | self.contextfunc = False |
| 359 | self.op = operands # raw operand tuple |
| 360 | self.context = context # context used for the operation |
| 361 | self.cop = RestrictedList() # converted C.Decimal operands |
| 362 | self.cex = RestrictedList() # Python exceptions for C.Decimal |
| 363 | self.cresults = RestrictedList() # C.Decimal results |
| 364 | self.pop = RestrictedList() # converted P.Decimal operands |
| 365 | self.pex = RestrictedList() # Python exceptions for P.Decimal |
| 366 | self.presults = RestrictedList() # P.Decimal results |
| 367 | |
| 368 | # If the above results are exact, unrounded and not clamped, repeat |
| 369 | # the operation with a maxcontext to ensure that huge intermediate |
| 370 | # values do not cause a MemoryError. |
| 371 | self.with_maxcontext = False |
| 372 | self.maxcontext = context.c.copy() |
| 373 | self.maxcontext.prec = C.MAX_PREC |
| 374 | self.maxcontext.Emax = C.MAX_EMAX |
| 375 | self.maxcontext.Emin = C.MIN_EMIN |
| 376 | self.maxcontext.clear_flags() |
| 377 | |
| 378 | self.maxop = RestrictedList() # converted C.Decimal operands |
| 379 | self.maxex = RestrictedList() # Python exceptions for C.Decimal |
| 380 | self.maxresults = RestrictedList() # C.Decimal results |
| 381 | |
| 382 | |
| 383 | # ====================================================================== |
no outgoing calls
searching dependent graphs…