A trait which is callable. Notes ----- Classes are callable, as are instances with a __call__() method.
| 4311 | |
| 4312 | |
| 4313 | class 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) |
no outgoing calls
no test coverage detected
searching dependent graphs…