"""Create fallback_executor
Generated by Phi-Octopus Eden
2025-11-07 20:50:32.080099
"""

```python
class FallbackExecutor:
    """
    A class for executing tasks that may fail and providing a fallback mechanism.
    
    :param primary_func: The primary function to be executed
    :type primary_func: Callable
    :param backup_func: The backup function to be executed if the primary fails
    :type backup_func: Callable
    :param error_types: List of exception types for which the fallback should be triggered
    :type error_types: Tuple[type[BaseException], ...]
    """
    
    def __init__(self, primary_func: callable, backup_func: callable, error_types: tuple = (Exception,)):
        self.primary_func = primary_func
        self.backup_func = backup_func
        self.error_types = error_types
    
    def execute(self, *args, **kwargs) -> Any:
        """
        Execute the primary function. If an exception occurs and it's in the specified types,
        fallback to the backup function.
        
        :param args: Positional arguments for primary_func
        :param kwargs: Keyword arguments for primary_func
        :return: The result of the executed function or None if both failed
        """
        try:
            return self.primary_func(*args, **kwargs)
        except self.error_types as e:
            print(f"Primary execution failed with error: {e}")
            backup_result = self.backup_func(*args, **kwargs)
            print("Falling back to the backup function.")
            return backup_result
        else:
            print("Primary function executed successfully.")
    
    def __call__(self, *args, **kwargs) -> Any:
        """Allow direct calling of the FallbackExecutor instance."""
        return self.execute(*args, **kwargs)


# Example usage
def primary_function(x):
    if x == 10:
        raise ValueError("Input is invalid")
    return x * 2

def backup_function(x):
    print("Using backup function.")
    return (x - 5) * 3

executor = FallbackExecutor(primary_function, backup_function)

# Test the fallback mechanism
result = executor(10)   # Should trigger fallback
print(f"Result: {result}")
result = executor(20)  # Should succeed with primary function
print(f"Result: {result}")


```