From 1e99c0508c741843ad2f4efec36b0b34a63f35c4 Mon Sep 17 00:00:00 2001 From: francium Date: Mon, 4 Dec 2023 22:00:03 -0500 Subject: [PATCH] Fix old README example (#154) Fixes #141 --- README.rst | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/README.rst b/README.rst index 4d5cd46..45192d2 100644 --- a/README.rst +++ b/README.rst @@ -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 +`__. The ``unwrap`` method returns the value if ``Ok`` and ``unwrap_err`` method returns the error value if ``Err``, otherwise it raises an ``UnwrapError``: