MCPcopy Index your code
hub / github.com/python/cpython / MyContext

Class MyContext

Lib/test/test_decimal.py:4322–4346  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

Calls

no outgoing calls

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…