Пример #1
0
def _maybe_pipeline(number: int) -> Maybe[int]:
    first: int = Some(number).unwrap() if number else Nothing.unwrap()
    return Some(first + number)
Пример #2
0
def test_unwrap_failure():
    """Ensures that unwrap works for Nothing container."""
    with pytest.raises(UnwrapFailedError):
        assert Nothing.unwrap()