"""Create fallback_executor
Generated by Phi-Octopus Eden
2025-11-07 03:51:31.667228
"""

```python
class FallbackExecutor:
    """
    A class for executing tasks with fallback mechanisms in case of errors.
    
    Attributes:
        primary_func (callable): The main function to execute.
        fallback_func (callable): The function to use if `primary_func` fails.

    Methods:
        run: Execute the task and handle any errors by falling back to a secondary function.
    """

    def __init__(self, primary_func: callable, fallback_func: callable):
        """
        Initialize FallbackExecutor with both primary and fallback functions.
        
        Args:
            primary_func (callable): The main function to execute.
            fallback_func (callable): The function to use if `primary_func` fails.
        """
        self.primary_func = primary_func
        self.fallback_func = fallback_func

    def run(self, *args, **kwargs) -> callable:
        """
        Execute the task using the primary function. If an exception occurs,
        fall back to the secondary function with the same arguments.
        
        Args:
            *args: Positional arguments passed to `primary_func`.
            **kwargs: Keyword arguments passed to `primary_func`.

        Returns:
            The result of either `primary_func` or `fallback_func`, depending on success.

        Raises:
            Exception: If both functions fail, the last exception is re-raised.
        """
        try:
            return self.primary_func(*args, **kwargs)
        except Exception as e1:
            try:
                return self.fallback_func(*args, **kwargs)
            except Exception as e2:
                raise e2

# Example usage
def divide(a: float, b: float) -> float:
    """Divide two numbers."""
    return a / b

def safe_divide(a: float, b: float) -> float:
    """Safe division with handling zero division error."""
    if b == 0:
        return 0.0
    return a / b

executor = FallbackExecutor(divide, safe_divide)
result = executor.run(10, 2)
print(result)  # Output: 5.0

result = executor.run(10, 0)
print(result)  # Output: 0.0
```