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

Method get_value

traitlets/config/loader.py:408–417  ·  view source on GitHub ↗

Get the value stored in this string

(self, trait: TraitType[t.Any, t.Any])

Source from the content-addressed store, hash-verified

406 """
407
408 def get_value(self, trait: TraitType[t.Any, t.Any]) -> t.Any:
409 """Get the value stored in this string"""
410 s = str(self)
411 try:
412 return trait.from_string(s)
413 except Exception:
414 # exception casting from string,
415 # let the original string lie.
416 # this will raise a more informative error when config is loaded.
417 return s
418
419 def __repr__(self) -> str:
420 return f"{self.__class__.__name__}({self._super_repr()})"

Callers 1

_exec_config_strMethod · 0.95

Calls 1

from_stringMethod · 0.45

Tested by

no test coverage detected