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

Method validate

traitlets/traitlets.py:3238–3241  ·  view source on GitHub ↗
(self, obj: t.Any, value: t.Any)

Source from the content-addressed store, hash-verified

3236 super().__init__(default_value, **kwargs)
3237
3238 def validate(self, obj: t.Any, value: t.Any) -> G:
3239 if self.values and value in self.values:
3240 return value # type:ignore[no-any-return]
3241 self.error(obj, value)
3242
3243 def _choices_str(self, as_rst: bool = False) -> str:
3244 """Returns a description of the trait choices (not none)."""

Callers 1

from_stringMethod · 0.95

Calls 1

errorMethod · 0.80

Tested by

no test coverage detected