File tree 1 file changed +6
-7
lines changed
1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -193,13 +193,12 @@ Access the value directly, without any other checks:
193
193
194
194
Note that this is a property, you cannot assign to it. Results are immutable.
195
195
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> `__.
203
202
204
203
The ``unwrap `` method returns the value if ``Ok `` and ``unwrap_err `` method
205
204
returns the error value if ``Err ``, otherwise it raises an ``UnwrapError ``:
You can’t perform that action at this time.
0 commit comments