ReturnRuleAny Class
- class kwhelp.decorator.ReturnRuleAny(*args: kwhelp.rules.IRule, **kwargs)[source]
Decorator that decorates methods that require return value to match any of the rules specificed.
See also
- __init__(*args: kwhelp.rules.IRule, **kwargs)[source]
Constructor
- Parameters
args (IRule) – One or more rules to use for validation
- Keyword Arguments
ftype (DecFuncType, optional) – Type of function that decorator is applied on. Default
DecFuncType.FUNCTION
opt_return (object, optional) – Return value when decorator is invalid. By default an error is rasied when validation fails. If
opt_return
is supplied then it will be return when validation fails and no error will be raised.opt_logger (Union[Logger, LoggerAdapter], optional) – Logger that logs exceptions when validation fails.