_check_callable#

skactiveml.utils._check_callable(func, name, n_positional_parameters=None)[source]#

Check whether func is callable with the expected arity.

Parameters:
funccallable

Callable to be validated.

namestr

Name used in error messages.

n_positional_parametersint, default=None

Expected number of positional parameters without defaults. If None, one positional parameter is expected.

Raises:
TypeError

If func is not callable.

ValueError

If func does not expose the expected number of positional parameters.