nicetoolbox.utils.check_and_exception.check_options

nicetoolbox.utils.check_and_exception.check_options(object, object_type, options) None[source]

Check if an object is of a specific type and if it is within a given list of options.

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

  • object_type (type) – The expected type of the object.

  • options (list) – A list of valid options for the object.

Raises:
  • TypeError – If the object is not of the expected type.

  • ValueError – If the object is not within the list of valid options.

Returns:

None