MCPcopy Create free account
hub / github.com/ipython/traitlets / _load_flag

Method _load_flag

traitlets/config/loader.py:694–702  ·  view source on GitHub ↗

update self.config from a flag, which can be a dict or Config

(self, cfg: t.Any)

Source from the content-addressed store, hash-verified

692 return
693
694 def _load_flag(self, cfg: t.Any) -> None:
695 """update self.config from a flag, which can be a dict or Config"""
696 if isinstance(cfg, (dict, Config)):
697 # don't clobber whole config sections, update
698 # each section from config:
699 for sec, c in cfg.items():
700 self.config[sec].update(c)
701 else:
702 raise TypeError("Invalid flag: %r" % cfg)
703
704
705# match --Class.trait keys for argparse

Callers 1

_convert_to_configMethod · 0.80

Calls 1

updateMethod · 0.45

Tested by

no test coverage detected