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

Class IOFailure

returns/io.py:819–849  ·  view source on GitHub ↗

``IOFailure`` representation.

Source from the content-addressed store, hash-verified

817
818@final
819class IOFailure(IOResult[Any, _ErrorType_co]):
820 """``IOFailure`` representation."""
821
822 __slots__ = ()
823
824 _inner_value: Result[Any, _ErrorType_co]
825
826 def __init__(self, inner_value: _ErrorType_co) -> None:
827 """IOFailure constructor."""
828 super().__init__(Failure(inner_value))
829
830 if not TYPE_CHECKING: # noqa: WPS604 # pragma: no branch
831
832 def bind(self, function):
833 """Does nothing for ``IOFailure``."""
834 return self
835
836 #: Alias for `bind_ioresult` method. Part of the `IOResultBasedN` interface. # noqa: E501
837 bind_ioresult = bind
838
839 def bind_result(self, function):
840 """Does nothing for ``IOFailure``."""
841 return self
842
843 def bind_io(self, function):
844 """Does nothing for ``IOFailure``."""
845 return self
846
847 def lash(self, function):
848 """Composes this container with a function returning ``IOResult``.""" # noqa: E501
849 return function(self._inner_value.failure())
850
851
852@final

Callers 15

from_failed_contextMethod · 0.90
from_failureMethod · 0.90
_use_failureFunction · 0.90
__call__Method · 0.90
test_inner_valueFunction · 0.90
test_bindFunction · 0.90
test_bind_regular_resultFunction · 0.90
factoryFunction · 0.90
test_bind_ioresultFunction · 0.90
test_bind_result_contextFunction · 0.90

Calls

no outgoing calls

Tested by 15

_use_failureFunction · 0.72
__call__Method · 0.72
test_inner_valueFunction · 0.72
test_bindFunction · 0.72
test_bind_regular_resultFunction · 0.72
factoryFunction · 0.72
test_bind_ioresultFunction · 0.72
test_bind_result_contextFunction · 0.72
test_equalsFunction · 0.72
test_not_equalsFunction · 0.72
_functionFunction · 0.72