(
        func: Callable[..., A],
        error: Union[Type[BaseException], Tuple[Type[BaseException]]],
        default: B
)
return wrapper
Wrap a `func` such that if `errors` occur `default` is returned instead.
Wrap a `func` such that if `errors` occur `default` is returned instead.
Wrap a func such that if errors occur default is returned instead .
def ftry(
        func: Callable[..., A],
        error: Union[Type[BaseException], Tuple[Type[BaseException]]],
        default: B
) -> Callable[..., Union[A, B]]:
    """
    Wrap a `func` such that if `errors` occur `default` is returned instead."""
    def wrapper(*args, **kwargs):
        try:
            return func(*args, **kwargs)
        except error:
            return default
    return wrapper
def ftry ( func : Callable [ ... , A ] , error : Union [ Type [ BaseException ] , Tuple [ Type [ BaseException ] ] ] , default : B ) -> Callable [ ... , Union [ A , B ] ] : def wrapper ( * args , * * kwargs ) : try : return func ( * args , * * kwargs ) except error : return default return wrapper