Closed
Description
Bug Report
When a type has multiple generics and is an iterable, the star operator results in the wrong type
from typing import Iterator, Generic, TypeVar
T = TypeVar("T")
T2 = TypeVar("T2")
class A(Iterator[T2], Generic[T, T2]):
...
a: A[int, Iterator[int]]
reveal_type((*a,))
b: list[list[int]] = [*a]
To Reproduce
(Write your steps here:)
- Step 1...
- Step 2...
- Step 3...
Expected Behavior
(Write what you thought would happen.)
Actual Behavior
(Write what happened.)
Your Environment
- Mypy version used: 0.910
- Mypy command-line flags: na
- Mypy configuration options from
mypy.ini
(and other config files): na - Python version used: 3.10
- Operating system and version: mypy playground