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