Result is defined as:
|
Result = Either[SuccessResult, ErrorResult] |
However, the runtime values are reversed:
|
def validate_result(result: Result) -> None: |
|
"""Validate the return value from a method. |
|
|
|
Raises an AssertionError if the result returned from a method is invalid. |
|
|
|
Returns: None |
|
""" |
|
assert (isinstance(result, Left) and isinstance(result._error, ErrorResult)) or ( |
|
isinstance(result, Right) and isinstance(result._value, SuccessResult) |
|
), f"The method did not return a valid Result (returned {result!r})" |
Therefore mypy complains if users type their methods with -> Result.
Resultis defined as:jsonrpcserver/jsonrpcserver/result.py
Line 34 in f489ed8
However, the runtime values are reversed:
jsonrpcserver/jsonrpcserver/dispatcher.py
Lines 105 to 114 in f489ed8
Therefore mypy complains if users type their methods with
-> Result.