Skip to content

Commit 49653ab

Browse files
committed
Rename is in progress
1 parent 6e8f531 commit 49653ab

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

returns/functions.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,15 @@
66
from returns.result import Failure, Success
77

88

9-
def is_successful(monad):
10-
"""Determins if a monad was a success or not."""
9+
def is_successful(container):
10+
"""
11+
Determins if a container was successful or not.
12+
13+
We treat container that raise ``UnwrapFailedError`` on ``.unwrap()``
14+
not successful.
15+
"""
1116
try:
12-
monad.unwrap()
17+
container.unwrap()
1318
except UnwrapFailedError:
1419
return False
1520
else:

returns/functions.pyi

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,20 @@ from returns.result import Result
77

88
_ContainerType = TypeVar('_ContainerType', bound=Container)
99
_ReturnType = TypeVar('_ReturnType')
10-
_ReturnsMonadType = TypeVar(
11-
'_ReturnsMonadType',
10+
_ReturnsContainerType = TypeVar(
11+
'_ReturnsContainerType',
1212
bound=Callable[..., Container],
1313
)
1414

1515

16-
def is_successful(monad: _ContainerType) -> bool:
16+
def is_successful(container: _ContainerType) -> bool:
1717
...
1818

1919

2020
# Typing decorators is not an easy task, see:
2121
# https://github.com/python/mypy/issues/3157
2222

23-
def pipeline(function: _ReturnsMonadType) -> _ReturnsMonadType:
23+
def pipeline(function: _ReturnsContainerType) -> _ReturnsContainerType:
2424
...
2525

2626

0 commit comments

Comments
 (0)