-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Incorrect subtyping with bound typevar #13220
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
Labels
affects-typeshed
Anything that blocks a typeshed change
bug
mypy got something wrong
topic-type-variables
Comments
This was referenced Jul 23, 2022
ShaneHarvey
added a commit
to ShaneHarvey/typeshed
that referenced
this issue
Jul 25, 2022
Slightly simpler reproducer: from typing import Callable, TypeVar
T = TypeVar("T", bound=list[int])
def raises(opts: T | None) -> T: pass
x: Callable[..., object] = raises Expected result: no error because Actual result: assignment on last line fails. |
ilevkivskyi
added a commit
that referenced
this issue
Sep 27, 2023
Fixes #13220 This looks a bit ad-hoc, but it is probably the least disruptive solution possible.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
affects-typeshed
Anything that blocks a typeshed change
bug
mypy got something wrong
topic-type-variables
From python/typeshed#8372
The text was updated successfully, but these errors were encountered: