Skip to content

Commit ec3b38f

Browse files
committed
Fixes docs
1 parent 73739a3 commit ec3b38f

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff 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

docs/pages/context.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff 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
)

returns/io.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)