Skip to content

Instantly share code, notes, and snippets.

@mypy-play
Created September 18, 2021 09:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mypy-play/5a316fc1e3ca8fb435ca40bbadd3ea66 to your computer and use it in GitHub Desktop.
Save mypy-play/5a316fc1e3ca8fb435ca40bbadd3ea66 to your computer and use it in GitHub Desktop.
Shared via mypy Playground
from typing import Iterator, Generic, TypeVar
T = TypeVar("T")
T2 = TypeVar("T2")
class A(Iterator[T2], Generic[T, T2]):
...
a: A[int, list[int]]
i = [*a]
reveal_type(i)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment