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/).
9393- Fixes that ` RequiresContextResult ` and ` RequiresContextIOResult `
9494 were not ` final `
9595- Fixes that ` ImmutableStateError ` was not a subclass of ` AttributeError `
96+ - Fixes that ` IOResult ` was not showing ` str ` representation
97+ of wrapped ` inner_value `
9698
9799### Misc
98100
Original file line number Diff line number Diff line change @@ -308,7 +308,7 @@ Here's how it should be used:
308308
309309.. code :: python
310310
311- from typing import Sequence
311+ from typing import Callable, Sequence
312312
313313 import anyio # you wound need to `pip install anyio`
314314 import httpx # you wound need to `pip install httpx`
@@ -318,6 +318,7 @@ Here's how it should be used:
318318 from returns.functions import tap
319319 from returns.future import FutureResultE, future_safe
320320 from returns.pipeline import managed
321+ from returns.result import safe
321322
322323 _URL : Final = ' https://jsonplaceholder.typicode.com/posts/{0} '
323324 _Post = TypedDict(' _Post' , {
@@ -336,8 +337,8 @@ Here's how it should be used:
336337 ) -> RequiresContextFutureResultE[httpx.AsyncClient, _Post]:
337338 return ContextFutureResult[httpx.AsyncClient].ask().bind_future_result(
338339 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)),
341342 ).map(
342343 lambda response : response.json(),
343344 )
Original file line number Diff line number Diff line change @@ -720,7 +720,7 @@ def from_iterable(
720720
721721 def __str__ (self ) -> str :
722722 """Custom ``str`` representation for better readability."""
723- return '<IOResult: {0}>' .format (self ._inner_value )
723+ return '<IOResult: {0}>' .format (str ( self ._inner_value ) )
724724
725725
726726@final
You can’t perform that action at this time.
0 commit comments