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
Bug Report
In some cases involving matching an argument against a union with type var tuples, mypy infers Never instead of something better.
Never
To Reproduce
from typing import TypeVarTuple, Unpack, Generic from collections.abc import Callable Args = TypeVarTuple("Args") class Built(Generic[Unpack[Args]]): pass def example(n: Built[Unpack[Args]] | Callable[[Unpack[Args]], None]) -> Built[Unpack[Args]]: ... reveal_type(example) # N: Revealed type is "def [Args] (n: Union[__main__.Built[Unpack[Args`-1]], def (*Unpack[Args`-1])]) -> __main__.Built[Unpack[Args`-1]]" @example # E: Argument 1 to "example" has incompatible type "Callable[[], None]"; expected "Built[*tuple[Never, ...]] | Callable[[VarArg(Never)], None]" def command1() -> None: return
Expected Behavior
I expect no error.
Your Environment
Checked in mypy playground.
mypy.ini
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Bug Report
In some cases involving matching an argument against a union with type var tuples, mypy infers
Never
instead of something better.To Reproduce
Expected Behavior
I expect no error.
Your Environment
Checked in mypy playground.
mypy.ini
(and other config files): N/AThe text was updated successfully, but these errors were encountered: