-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
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
Typehints #11
Comments
I think the problem is in the Typing linters don't understand >>> maybe(Maybe()).log
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'Maybe' object has no attribute 'log' Сan use @overload
def maybe(value: Maybe) -> Maybe: # But such code can also be broken if `Maybe` is a child element of object
...
@overload
def maybe(value: None) -> Nothing:
...
@overload
def maybe(value) -> Something:
... Therefore, it is more logical to remove these lines or make a function without them: if isinstance(value, Maybe):
return value |
LEv145
added a commit
to LEv145/pymaybe
that referenced
this issue
Dec 23, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey, just stumbled on this library when a friend recommended it to me.
I like the syntax sugar, but I noticed it doesn't provide typehints, so the code I would save with this I need to spend doing
cast
.Is that by design / for a particular reason? If not, would you accept a PR adding them?
The text was updated successfully, but these errors were encountered: