We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When use alias Success and Failure and the return typing is a Result. the IDE warns us, as in the following example:
Success
Failure
This is the current implementation:
from typing import Any, Generic, cast from meiga.error import Error from meiga.result import TF, TS, Result class Success(Result, Generic[TS]): def __init__(self, value: TS = cast(TS, True)) -> None: Result.__init__(self, success=value) class Failure(Result, Generic[TF]): def __init__(self, error: TF = cast(TF, Error())) -> None: Result.__init__(self, failure=error)
We want to match typed return with returned one.
Could we use a function to resolve this
def Success(value: TS = cast(TS, True)) -> Result: return Result(success=value) def Failure(error: TF = cast(TF, Error())) -> Result: return Result(failure=error)
No response
macOS
1.6.1
3.10.6
The text was updated successfully, but these errors were encountered:
acostapazo
Successfully merging a pull request may close this issue.
First Check
Description
When use alias
Success
andFailure
and the return typing is a Result. the IDE warns us, as in the following example:This is the current implementation:
Wanted Solution
We want to match typed return with returned one.
Could we use a function to resolve this
Wanted Code
Alternatives
No response
Operating System
macOS
Operating System Details
No response
meiga Version
1.6.1
Python Version
3.10.6
Additional Context
No response
The text was updated successfully, but these errors were encountered: