We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Hashable
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
I'd expect to get a type error when trying to pass a tuple to a Hashable bound if that tuple contains any non-hashable element type.
tuple
To Reproduce
from typing import Hashable, TypeVar T = TypeVar("T", bound=Hashable) def f(x: T) -> T: print(hash(x)) return x def usage1(x: tuple[dict[str, str], ...]): f(x) def usage2(x: tuple[dict[str, str], int, int]): f(x) def usage3(x: tuple[int, int, dict[str, str]]): f(x)
Expected Behavior
Type error in all f(x) lines, rejecting the non-hashable type.
f(x)
Actual Behavior
The type check passes despite the unsound typing.
Your Environment
mypy.ini
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Bug Report
I'd expect to get a type error when trying to pass a
tuple
to aHashable
bound if that tuple contains any non-hashable element type.To Reproduce
Expected Behavior
Type error in all
f(x)
lines, rejecting the non-hashable type.Actual Behavior
The type check passes despite the unsound typing.
Your Environment
mypy.ini
(and other config files):The text was updated successfully, but these errors were encountered: