File tree Expand file tree Collapse file tree 3 files changed +7
-4
lines changed Expand file tree Collapse file tree 3 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -93,6 +93,8 @@ See [0Ver](https://0ver.org/).
93
93
- Fixes that ` RequiresContextResult ` and ` RequiresContextIOResult `
94
94
were not ` final `
95
95
- Fixes that ` ImmutableStateError ` was not a subclass of ` AttributeError `
96
+ - Fixes that ` IOResult ` was not showing ` str ` representation
97
+ of wrapped ` inner_value `
96
98
97
99
### Misc
98
100
Original file line number Diff line number Diff line change @@ -308,7 +308,7 @@ Here's how it should be used:
308
308
309
309
.. code :: python
310
310
311
- from typing import Sequence
311
+ from typing import Callable, Sequence
312
312
313
313
import anyio # you wound need to `pip install anyio`
314
314
import httpx # you wound need to `pip install httpx`
@@ -318,6 +318,7 @@ Here's how it should be used:
318
318
from returns.functions import tap
319
319
from returns.future import FutureResultE, future_safe
320
320
from returns.pipeline import managed
321
+ from returns.result import safe
321
322
322
323
_URL : Final = ' https://jsonplaceholder.typicode.com/posts/{0} '
323
324
_Post = TypedDict(' _Post' , {
@@ -336,8 +337,8 @@ Here's how it should be used:
336
337
) -> RequiresContextFutureResultE[httpx.AsyncClient, _Post]:
337
338
return ContextFutureResult[httpx.AsyncClient].ask().bind_future_result(
338
339
lambda client : future_safe(client.get)(_URL .format(post_id)),
339
- ).map (
340
- lambda response : tap(httpx.Response.raise_for_status)(response ),
340
+ ).bind_result (
341
+ safe( tap(httpx.Response.raise_for_status)),
341
342
).map(
342
343
lambda response : response.json(),
343
344
)
Original file line number Diff line number Diff line change @@ -720,7 +720,7 @@ def from_iterable(
720
720
721
721
def __str__ (self ) -> str :
722
722
"""Custom ``str`` representation for better readability."""
723
- return '<IOResult: {0}>' .format (self ._inner_value )
723
+ return '<IOResult: {0}>' .format (str ( self ._inner_value ) )
724
724
725
725
726
726
@final
You can’t perform that action at this time.
0 commit comments