We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 19637ad commit 3ea3b26Copy full SHA for 3ea3b26
expression/core/result.py
@@ -195,12 +195,7 @@ def map2(
195
other: Ok[_TOther, _TError] | Error[_TOther, _TError],
196
mapper: Callable[[_TSource, _TOther], _TResult],
197
) -> Result[_TResult, _TError]:
198
- # assert isinstance(other, (Ok, Error))
199
- match other:
200
- case Ok(value):
201
- return Ok(mapper(self._value, value))
202
- case Error(error):
203
- return Error(error)
+ return other.map(lambda value: mapper(self._value, value))
204
205
def bind(
206
self, mapper: Callable[[_TSource], Result[_TResult, _TError]]
0 commit comments