argclz.validator.ListItemValidatorBuilder#

class argclz.validator.ListItemValidatorBuilder[source]#

Bases: LambdaValidator

__init__(validator, message=None)#
Parameters:
  • validator (Callable[[T], bool]) – callable

  • message (str | Callable[[T], str] | None) – failure message. It could be a str message that contains one %-formating expression (for example: ‘%s’), or a callable (T)->str.

Methods Summary

__init__(validator[, message])

freeze()

(internal use) return a copy of itself.

__call__(value)

Details

__call__(value)[source]#
Parameters:

value (Any) – type-casted value.

Returns:

True if value pass the validation.

Raises:

ValueError – when value does not pass the validation.

Return type:

bool

freeze()[source]#

(internal use) return a copy of itself.

Return type:

Self