from typing import TypeVar, Generic, Sequence
T = TypeVar("T")
class A(Generic[T]):
pass
class B(A[Sequence[T]], Generic[T]):
pass
b: B[int] = B()
reveal_type(b)
is B[int]
as expected. Is there any way for reveal_type
to instead tell me A[Sequence[int]]
?
In this simple example this isn't useful, but in the case I am debugging knowing how the supertype was parametrized given a parametrized subtype without having to manually connect the dots (and potentially contradict what mypy
infers) would clear up things a lot.