Skip to main content

validate_call

Returns a decorated wrapper around the function that validates the arguments and, optionally, the return value.

def validate_call(
func: AnyCallableT | None = None,
config: ConfigDict | None = None,
validate_return: bool = False
) - > AnyCallableT | Callable[[AnyCallableT], AnyCallableT]

Returns a decorated wrapper around the function that validates the arguments and, optionally, the return value.

Parameters

NameTypeDescription
func`AnyCallableTNone` = None
config`ConfigDictNone` = None
validate_returnbool = FalseWhether to validate the return value of the decorated function against its type hint.

Returns

TypeDescription
`AnyCallableTCallable[[AnyCallableT], AnyCallableT]`