Skip to content

Instantly share code, notes, and snippets.

@mypy-play
Created September 19, 2021 00:26
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/e7a3eb908190fd06c04032459aae0d70 to your computer and use it in GitHub Desktop.
Save mypy-play/e7a3eb908190fd06c04032459aae0d70 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[str, Iterator[int]]
reveal_type((*a,))
reveal_type([*a])
b: list[int] = [*a]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment