conditional_execute#
- conditional_execute(func, execute_operation, alt_func=<function noop>)[source]#
Return the given function or a no-op function based on execute_operation.
- Parameters:
- funcCallable
Callable.
- alt_funcCallable
Callable to return if
execute_operation
is False, no-op by default.- execute_operationbool
Whether to return
func
or aalt_func
function.
- Returns:
- Callable
func
ifexecute_operation
elsealt_func
.