*Memo:
mypy --strict test.py
- mypy 1.19.0
- Python 3.14.0
- Windows 11
reveal_type() can get T type of the instance of a generic class as shown below:
class MyCls[T = int]:
def __init__(self, x: T | None = None) -> None: ...
reveal_type(MyCls()) # builtins.int
But reveal_type() cannot get *Ts type of the instance of a generic class as shown below:
class MyCls[*Ts = *tuple[int, ...]]:
def __init__(self, *args: *Ts) -> None: ...
reveal_type(MyCls()) # ()