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

Method validate

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

Source from the content-addressed store, hash-verified

2766 )
2767
2768 def validate(self, obj: t.Any, value: t.Any) -> G:
2769 if isinstance(value, int):
2770 value = float(value)
2771 if not isinstance(value, float):
2772 self.error(obj, value)
2773 return _validate_bounds(self, obj, value) # type:ignore[no-any-return]
2774
2775 def from_string(self, s: str) -> G:
2776 if self.allow_none and s == "None":

Callers

nothing calls this directly

Calls 2

_validate_boundsFunction · 0.85
errorMethod · 0.80

Tested by

no test coverage detected