argclz.validator.TupleItemValidatorBuilder#

class argclz.validator.TupleItemValidatorBuilder[source]#

Bases: LambdaValidator

__init__(item, validator)[source]#
Parameters:
  • validator (Callable[[Any], bool]) – callable

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

  • item (int | list[int] | None)

Methods Summary

__init__(item, validator)

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