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
Invalid types are inferred for f(*expr) below:
f(*expr)
from typing import Iterable, Iterator, Tuple, TypeVar T = TypeVar('T') S = TypeVar('S') class C(Iterable[Tuple[T, S]]): def __iter__(self) -> Iterator[Tuple[T, S]]: pass def f(*x: T) -> T: pass x: C[str, int] y: C[int, int] reveal_type(f(*x)) # str, should be Tuple[str, int] reveal_type(f(*y)) # int, should be Tuple[int, int]
The problem seems to be related to type inference of *args in calls where there is non-trivial generic inheritance from Iterable such as in C above.
*args
Iterable
C
Originally reported as python/typeshed#1600.
The text was updated successfully, but these errors were encountered:
This was actually originally reported in #3943
Sorry, something went wrong.
This appears to be fixed. It now produces the expected results. (Note: the last line in the code sample above should say "should be Tuple[int, int]".)
No branches or pull requests
Invalid types are inferred for
f(*expr)
below:The problem seems to be related to type inference of
*args
in calls where there is non-trivial generic inheritance fromIterable
such as inC
above.Originally reported as python/typeshed#1600.
The text was updated successfully, but these errors were encountered: