File tree Expand file tree Collapse file tree 2 files changed +11
-6
lines changed
Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change 11# -*- coding: utf-8 -*-
22
3- from functools import reduce
4-
5- from returns ._generated .pipeline import pipe
3+ # We import from the source, becase otherwise we will have a circular import.
4+ from returns ._generated .pipeline .pipe import _pipe
65
76
87def _flow (instance , * functions ):
@@ -30,4 +29,4 @@ def _flow(instance, *functions):
3029 - https://github.com/gcanti/fp-ts/blob/master/src/pipeable.ts
3130
3231 """
33- return pipe . _pipe (* functions )(instance )
32+ return _pipe (* functions )(instance )
Original file line number Diff line number Diff line change 22
33from typing import Union
44
5- from returns ._generated .pipeline .pipe import _pipe as pipe # noqa: F401
65from returns ._generated .pipeline .flow import _flow as flow # noqa: F401
7- from returns ._generated .pipeline .pipeline import _pipeline as pipeline # noqa: F401
6+ from returns ._generated .pipeline .pipe import _pipe as pipe # noqa: F401
87from returns .io import IOResult
98from returns .maybe import Maybe
109from returns .primitives .exceptions import UnwrapFailedError
1110from returns .result import Result
1211
12+ from returns ._generated .pipeline .pipeline import ( # isort:skip # noqa: F401
13+ _pipeline as pipeline ,
14+ )
15+
1316# Logical aliases:
1417_Unwrapable = Union [Result , Maybe , IOResult ]
1518
@@ -34,6 +37,9 @@ def is_successful(container: '_Unwrapable') -> bool:
3437 >>> is_successful(Failure(1))
3538 False
3639
40+ This function can work with containers that support
41+ :class:`returns.primitives.interfaces.Unwrapable` protocol.
42+
3743 """
3844 try :
3945 container .unwrap ()
You can’t perform that action at this time.
0 commit comments