Skip to content

Commit

Permalink
Fix old README example (#154)
Browse files Browse the repository at this point in the history
Fixes #141
  • Loading branch information
francium authored Dec 5, 2023
1 parent 00a8cbc commit 1e99c05
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -193,13 +193,12 @@ Access the value directly, without any other checks:

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

For your convenience, simply creating an ``Ok`` result without value is the same as using ``True``:

.. sourcecode:: python

>>> res1 = Ok()
>>> res1.value
True
When the value inside is irrelevant, we suggest using ``None`` or a ``bool``,
but you're free to use any value you think works best. An instance of a
``Result`` (``Ok`` or ``Err``) must always contain something. If you're looking for a
type that might contain a value you may be interested in
a `maybe
<https://github.com/rustedpy/maybe>`__.

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

0 comments on commit 1e99c05

Please sign in to comment.