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.
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
Mypy doesn't seem to infer constraints correctly for TypedDicts. Example:
from typing import TypeVar, Iterable from mypy_extensions import TypedDict T = TypeVar('T') def f(x: Iterable[T]) -> T: pass A = TypedDict('A', {'x': int}) a: A reveal_type(f(a)) # Argument 1 to "f" has incompatible type "A"; expected Iterable[<nothing>]
The f(a) call should be okay and the revealed type should be str. This affects iter() at least.
f(a)
str
iter()
The text was updated successfully, but these errors were encountered:
Fix constraint inference for TypedDict and Iterable[T]
3a21647
Fixes #3610.
Fix constraint inference for TypedDict and Iterable[T] (#3611)
0b4fde6
JukkaL
No branches or pull requests
Mypy doesn't seem to infer constraints correctly for TypedDicts. Example:
The
f(a)
call should be okay and the revealed type should bestr
. This affectsiter()
at least.The text was updated successfully, but these errors were encountered: