-
Notifications
You must be signed in to change notification settings - Fork 32
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
Return signature check corner case for generic types #60
Comments
@brentyi thanks for reporting! |
@ashwin153 I think you fix this already.. So just a fast release now should fix this. |
@brentyi I just released 4.1.1 . I tested that locally on your example file and could not reproduce the problem. |
@mkorpela really appreciate the quick release! Looks like this fixed the issue I cited above. I'm still running into some minor errors with TypeVars. Even more niche, but I have several instances where I override one generic signature with a more specific generic signature. Something like this:
This results in a |
The error messages should be improved. |
Then again .. self is a specific python thing that could be handled a bit differently. |
Hello,
A lot of the code I'm currently writing relies pretty heavily on
TypeVar
definitions. Woke up this morning and found out that some of it stopped running!It seems like the newest release of
overrides
adds some stricter signature checking, which throws an error when my parent class's function signatures rely on TypeVars:I get a
TypeError: 'Subclass' is not a '~T'.
message, becausetyping_utils.issubtype
doesn't considerSubclass
here to be a subtype ofTypeVar("T", bound="ParentClass")
.Is this expected behavior? The setup is a little niche, but in my experience it's at least well-supported by
mypy
.Thanks!!
The text was updated successfully, but these errors were encountered: