ConfigValidator

class tfsnippet.utils.ConfigValidator

Bases: object

Base config value validator.

Methods Summary

validate(value[, strict]) Validate the value.

Methods Documentation

validate(value, strict=False)

Validate the value.

Parameters:
  • value – The value to be validated.
  • strict (bool) – If True, disable type conversion. If False, the validator will try its best to convert the input value into desired type.
Returns:

The validated value.

Raises:

ValueError, TypeError – If the value cannot pass validation.