We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
This is probably a herp derp on my part but I can't figure out what's wrong here.
Example:
from typing import * class C: pass C_T = TypeVar("C_T", bound=C) def func(factory: Type[C_T] = C) -> C_T: return factory()
On the penultimate line Mypy reports:
error: Incompatible default for argument "type" (default has type "Type[C]", argument has type "Type[C_T]")
I would expect it to be happy about the default.
The text was updated successfully, but these errors were encountered:
I'm not 100% sure but you may check #7864 on @ilevkivskyi 's clarification about default values.
Sorry, something went wrong.
This is actually a special case that we might want to special-case, see #3737. But yes, the general solution is to use overloads.
No branches or pull requests
This is probably a herp derp on my part but I can't figure out what's wrong here.
Example:
On the penultimate line Mypy reports:
I would expect it to be happy about the default.
The text was updated successfully, but these errors were encountered: