Skip to content

Commit d9b1b41

Browse files
committed
Addresses review
1 parent 83ff653 commit d9b1b41

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

docs/pages/io.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ It means, that it cannot be used where regular ``bool`` can be:
9595
...
9696
9797
is_successful: IO[bool] = can_book_seats(number_of_seats, place_id)
98-
notify_user_about_booking_result(is_successful) # Boom! Expects `bool`
98+
notify_user_about_booking_result(is_successful) # Boom!
99+
# => Argument 1 has incompatible type "IO[bool]"; expected "bool"
99100
100101
See? It is now impossible for a pure function to use ``IO[bool]``.
101102
It is impossible to unwrap or get a value from this container.

tests/test_io/test_io.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,8 @@ def test_io_bind():
1515
assert IO('a').bind(
1616
lambda number: IO(number + 'b'),
1717
) == IO('ab')
18+
19+
20+
def test_io_str():
21+
"""Ensures that IO container supports str cast."""
22+
assert str(IO([])) == '<IO: []>'

0 commit comments

Comments
 (0)