MCPcopy Index your code
hub / github.com/dry-python/returns / factory

Function factory

returns/future.py:1630–1637  ·  view source on GitHub ↗
(
            *args: _FuncParams.args,
            **kwargs: _FuncParams.kwargs,
        )

Source from the content-addressed store, hash-verified

1628 inner_exceptions: tuple[type[_ExceptionType], ...],
1629 ) -> Callable[_FuncParams, FutureResult[_ValueType_co, _ExceptionType]]:
1630 async def factory(
1631 *args: _FuncParams.args,
1632 **kwargs: _FuncParams.kwargs,
1633 ) -> Result[_ValueType_co, _ExceptionType]:
1634 try:
1635 return Success(await function(*args, **kwargs))
1636 except inner_exceptions as exc:
1637 return Failure(exc)
1638
1639 @wraps(function)
1640 def decorator(

Callers 5

__aiter__Method · 0.70
doMethod · 0.70
__aiter__Method · 0.70
doMethod · 0.70
decoratorFunction · 0.70

Calls 2

SuccessClass · 0.90
FailureClass · 0.90

Tested by

no test coverage detected