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

Method length_error

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

Source from the content-addressed store, hash-verified

3698 super().__init__(trait=trait, default_value=default_value, **kwargs)
3699
3700 def length_error(self, obj: t.Any, value: t.Any) -> None:
3701 e = (
3702 "The '%s' trait of %s instance must be of length %i <= L <= %i, but a value of %s was specified."
3703 % (self.name, class_of(obj), self._minlen, self._maxlen, value)
3704 )
3705 raise TraitError(e)
3706
3707 def validate_elements(self, obj: t.Any, value: t.Any) -> t.Any:
3708 length = len(value)

Callers 1

validate_elementsMethod · 0.95

Calls 2

class_ofFunction · 0.85
TraitErrorClass · 0.85

Tested by

no test coverage detected