Get value from successful container or raise exception for failed one. .. code:: pycon :force: >>> from returns.io import IO, IOFailure, IOSuccess >>> assert IOSuccess(1).unwrap() == IO(1) >>> IOFailure(1).unwrap() Traceback (most
(self)
| 575 | return IO(self._inner_value.value_or(default_value)) |
| 576 | |
| 577 | def unwrap(self) -> IO[_ValueType_co]: |
| 578 | """ |
| 579 | Get value from successful container or raise exception for failed one. |
| 580 | |
| 581 | .. code:: pycon |
| 582 | :force: |
| 583 | |
| 584 | >>> from returns.io import IO, IOFailure, IOSuccess |
| 585 | >>> assert IOSuccess(1).unwrap() == IO(1) |
| 586 | |
| 587 | >>> IOFailure(1).unwrap() |
| 588 | Traceback (most recent call last): |
| 589 | ... |
| 590 | returns.primitives.exceptions.UnwrapFailedError |
| 591 | |
| 592 | """ |
| 593 | return IO(self._inner_value.unwrap()) |
| 594 | |
| 595 | def failure(self) -> IO[_ErrorType_co]: |
| 596 | """ |