nicetoolbox.utils.check_and_exception.check_value_bounds

nicetoolbox.utils.check_and_exception.check_value_bounds(object, object_type=None, object_min=None, object_max=None) None[source]

Check if an object’s value falls within specified bounds.

Parameters:
  • object (any) – The object to be checked.

  • object_type (type, optional) – The expected type of the object. Defaults to None.

  • object_min (any, optional) – The minimum value allowed for the object. Defaults to None.

  • object_max (any, optional) – The maximum value allowed for the object. Defaults to None.

Raises:
  • TypeError – If the object is not of the expected type (if object_type is provided).

  • ValueError – If the object’s value is less than object_min (if object_min is provided). If the object’s value is greater than object_max (if object_max is provided).

Returns:

None