is_valid_function#

classmethod FunctionStopper.is_valid_function(fn: Any) → bool[source]#

Whether fn is a callable, other than a Stopper, to wrap.

Parameters:

fn (Any) – The object to check.

Returns:

True if fn is callable and isn’t a Stopper, False otherwise.

Raises:

ValueError – If fn qualifies but has a stop_all attribute, since it’s likely meant to be a Stopper.

Return type:

bool