Skip to content

Commit 1e99c05

Browse files
authored
Fix old README example (#154)
Fixes #141
1 parent 00a8cbc commit 1e99c05

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

README.rst

+6-7
Original file line numberDiff line numberDiff line change
@@ -193,13 +193,12 @@ Access the value directly, without any other checks:
193193

194194
Note that this is a property, you cannot assign to it. Results are immutable.
195195

196-
For your convenience, simply creating an ``Ok`` result without value is the same as using ``True``:
197-
198-
.. sourcecode:: python
199-
200-
>>> res1 = Ok()
201-
>>> res1.value
202-
True
196+
When the value inside is irrelevant, we suggest using ``None`` or a ``bool``,
197+
but you're free to use any value you think works best. An instance of a
198+
``Result`` (``Ok`` or ``Err``) must always contain something. If you're looking for a
199+
type that might contain a value you may be interested in
200+
a `maybe
201+
<https://github.com/rustedpy/maybe>`__.
203202

204203
The ``unwrap`` method returns the value if ``Ok`` and ``unwrap_err`` method
205204
returns the error value if ``Err``, otherwise it raises an ``UnwrapError``:

0 commit comments

Comments
 (0)