-
Notifications
You must be signed in to change notification settings - Fork 40
Closed
Description
Result is defined as:
jsonrpcserver/jsonrpcserver/result.py
Line 34 in f489ed8
| Result = Either[SuccessResult, ErrorResult] |
However, the runtime values are reversed:
jsonrpcserver/jsonrpcserver/dispatcher.py
Lines 105 to 114 in f489ed8
| 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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels