check_kwargs

sconstool.util.check_kwargs(caller, kw, allowed=None, forbidden=None)[source]

Checks all keys from keyword arguments kw against allowed and forbidden keys.

If key is not in allowed keys or it is in forbidden keys, throws TypeError.

Parameters:
  • caller (str) – name of the caller,
  • key (str) – the key to be examined,
  • allowed – sequence of allowed keys.
  • forbidden – sequence of forbidden keys.
Returns:

True