result
This module contains the Result variants returned by
all Client calls.
Correct usage
Incorrect usage
Err
Bases: Result[T, E]
Info
You will receive instances of this class as a result of
calling Client methods, and should not have to
instantiate it yourself.
Source code in wom/result.py
unwrap
Always throws an exception for the Err variant.
Raises:
| Type | Description |
|---|---|
UnwrapError
|
Because the result was an |
Source code in wom/result.py
Ok
Bases: Result[T, E]
Info
You will receive instances of this class as a result of
calling Client methods, and should not have to
instantiate it yourself.
Source code in wom/result.py
unwrap
unwrap_err
Always throws an exception for the Ok variant.
Raises:
| Type | Description |
|---|---|
UnwrapError
|
Because the result was an |
Source code in wom/result.py
Result
Bases: t.Generic[T, E], abc.ABC
Represents a potential Ok or Err result.
Note
This class cannot be instantiated, only its variants can be.
Source code in wom/result.py
unwrap
abstractmethod
Unwraps the result to produce the value.
Returns:
| Type | Description |
|---|---|
T
|
The unwrapped value. |
Raises:
| Type | Description |
|---|---|
UnwrapError
|
unwrap_err
abstractmethod
Unwraps the result to produce the error.
Returns:
| Type | Description |
|---|---|
E
|
The unwrapped error. |
Raises:
| Type | Description |
|---|---|
UnwrapError
|