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_operationis False, identity by default.- execute_operationbool
Whether to return
funcor aalt_funcfunction.
- Returns:
- Callable
funcifexecute_operationelsealt_func.