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

Method __init__

Lib/_pydecimal.py:3866–3900  ·  view source on GitHub ↗
(self, prec=None, rounding=None, Emin=None, Emax=None,
                       capitals=None, clamp=None, flags=None, traps=None,
                       _ignored_flags=None)

Source from the content-addressed store, hash-verified

3864 """
3865
3866 def __init__(self, prec=None, rounding=None, Emin=None, Emax=None,
3867 capitals=None, clamp=None, flags=None, traps=None,
3868 _ignored_flags=None):
3869 # Set defaults; for everything except flags and _ignored_flags,
3870 # inherit from DefaultContext.
3871 try:
3872 dc = DefaultContext
3873 except NameError:
3874 pass
3875
3876 self.prec = prec if prec is not None else dc.prec
3877 self.rounding = rounding if rounding is not None else dc.rounding
3878 self.Emin = Emin if Emin is not None else dc.Emin
3879 self.Emax = Emax if Emax is not None else dc.Emax
3880 self.capitals = capitals if capitals is not None else dc.capitals
3881 self.clamp = clamp if clamp is not None else dc.clamp
3882
3883 if _ignored_flags is None:
3884 self._ignored_flags = []
3885 else:
3886 self._ignored_flags = _ignored_flags
3887
3888 if traps is None:
3889 self.traps = dc.traps.copy()
3890 elif not isinstance(traps, dict):
3891 self.traps = dict((s, int(s in traps)) for s in _signals + traps)
3892 else:
3893 self.traps = traps
3894
3895 if flags is None:
3896 self.flags = dict.fromkeys(_signals, 0)
3897 elif not isinstance(flags, dict):
3898 self.flags = dict((s, int(s in flags)) for s in _signals + flags)
3899 else:
3900 self.flags = flags
3901
3902 def _set_integer_check(self, name, value, vmin, vmax):
3903 if not isinstance(value, int):

Callers

nothing calls this directly

Calls 3

isinstanceFunction · 0.85
copyMethod · 0.45
fromkeysMethod · 0.45

Tested by

no test coverage detected