-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Stubs for e.g. int.__add__ need to be more sophisticated #649
Comments
I don't think that the example is correct:
Maybe we just need to add a bunch of operator method overrides to the stubs for |
Hm, mypy doesn't like the overloads. This works but makes me feel dirty: class bool(int, SupportsInt, SupportsFloat):
def __init__(self, o: object = ...) -> None: ...
@overload # type: ignore
def __and__(self, n: bool) -> bool: ...
@overload
def __and__(self, n: int) -> int: ... |
Is this still an issue? At least the code from the original bug report type checks fine with 0.641: a = True
a &= True |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See python/mypy#1684. Looks like we need something like
and ditto for
|
and^
.oThe text was updated successfully, but these errors were encountered: