-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Old TypeVar and new [T:] annotations are not equivalent #17749
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 u 8000 p 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
Comments
Your two examples are different. In one case, you're defining a type variable with an upper bound ( F = TypeVar("F", bound=Callable[..., Any]) |
Oh, I see now. Thanks! But if that is so, it should probably be reflected in the output? For now, the 'Redefinition' output is just missing, which is definitely wrong (bug number 1). For this not to be the case, Should I file separate issues for thes 99F2 e? |
Or should we reopen this one? |
Bug Report
If the same function is defined with old
TypeVar
syntax in one place and with new[T:]
syntax in other place,mypy
doesn't consider them equivalent.To Reproduce
https://mypy-play.net/?mypy=1.11.2&python=3.12&enable-incomplete-feature=NewGenericSyntax&gist=78806d2f754ba0e5ce9bdcb61909fbc6
The text was updated successfully, but these errors were encountered: