MCPcopy
hub / github.com/marshmallow-code/marshmallow / predicate

Function predicate

tests/base.py:82–89  ·  view source on GitHub ↗
(
    func: typing.Callable[[typing.Any], bool],
)

Source from the content-addressed store, hash-verified

80
81
82def predicate(
83 func: typing.Callable[[typing.Any], bool],
84) -> typing.Callable[[typing.Any], None]:
85 def validate(value: typing.Any) -> None:
86 if func(value) is False:
87 raise ValidationError("Invalid value.")
88
89 return validate
90
91
92##### Models #####

Calls

no outgoing calls

Used in the wild real call sites across dependent graphs

searching dependent graphs…