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

Class Callable

traitlets/traitlets.py:4313–4327  ·  view source on GitHub ↗

A trait which is callable. Notes ----- Classes are callable, as are instances with a __call__() method.

Source from the content-addressed store, hash-verified

4311
4312
4313class Callable(TraitType[t.Callable[..., t.Any], t.Callable[..., t.Any]]):
4314 """A trait which is callable.
4315
4316 Notes
4317 -----
4318 Classes are callable, as are instances
4319 with a __call__() method."""
4320
4321 info_text = "a callable"
4322
4323 def validate(self, obj: t.Any, value: t.Any) -> t.Any:
4324 if callable(value):
4325 return value
4326 else:
4327 self.error(obj, value)

Callers 1

CallableTraitClass · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…