MCPcopy
hub / github.com/python-attrs/attrs / is_callable

Function is_callable

src/attr/validators.py:316–329  ·  view source on GitHub ↗

A validator that raises a `attrs.exceptions.NotCallableError` if the initializer is called with a value for this particular attribute that is not callable. .. versionadded:: 19.1.0 Raises: attrs.exceptions.NotCallableError: With a human readable error messa

()

Source from the content-addressed store, hash-verified

314
315
316def is_callable():
317 """
318 A validator that raises a `attrs.exceptions.NotCallableError` if the
319 initializer is called with a value for this particular attribute that is
320 not callable.
321
322 .. versionadded:: 19.1.0
323
324 Raises:
325 attrs.exceptions.NotCallableError:
326 With a human readable error message containing the attribute
327 (`attrs.Attribute`) name, and the value it got.
328 """
329 return _IsCallableValidator()
330
331
332@attrs(repr=False, slots=True, unsafe_hash=True)

Callers 5

test_successMethod · 0.90
test_failMethod · 0.90
test_reprMethod · 0.90
_DeepIterableClass · 0.85
_DeepMappingClass · 0.85

Calls 1

Tested by 3

test_successMethod · 0.72
test_failMethod · 0.72
test_reprMethod · 0.72