libconfig.Config.check_option

Config.check_option(key, subkey, value)

Evaluate if a given value fits the option.

If an option has a limited set of available values, check if the provided value is amongst them.

Parameters:
  • key (str) – First identifier of the option.
  • subkey (str) – Second identifier of the option.
  • value – Value to test (type varies).
Returns:

bool - does value belong to the options?

Raise:
NotRegisteredError:
 If key or subkey do not define any option.
ValueError:If the provided value is not the expected type for the option.