MCPcopy Index your code
hub / github.com/RustPython/RustPython / MyContext

Class MyContext

Lib/test/test_decimal.py:4321–4345  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4319 InvalidOperation = decimal.InvalidOperation
4320
4321 class MyContext(Context):
4322 def __init__(self, prec=None, rounding=None, Emin=None, Emax=None,
4323 capitals=None, clamp=None, flags=None,
4324 traps=None):
4325 Context.__init__(self)
4326 if prec is not None:
4327 self.prec = prec
4328 if rounding is not None:
4329 self.rounding = rounding
4330 if Emin is not None:
4331 self.Emin = Emin
4332 if Emax is not None:
4333 self.Emax = Emax
4334 if capitals is not None:
4335 self.capitals = capitals
4336 if clamp is not None:
4337 self.clamp = clamp
4338 if flags is not None:
4339 if isinstance(flags, list):
4340 flags = {v:(v in flags) for v in OrderedSignals[decimal] + flags}
4341 self.flags = flags
4342 if traps is not None:
4343 if isinstance(traps, list):
4344 traps = {v:(v in traps) for v in OrderedSignals[decimal] + traps}
4345 self.traps = traps
4346
4347 c = Context()
4348 d = MyContext()

Callers 1

Calls

no outgoing calls

Tested by 1