You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
reveal_type(x) where x: Tuple[int, ...] doesn't show "..." #9522
Using reveal_type() on a variable whose type is a variable-length tuple shows misleading output.
While it's different from the output for a fixed-length tuple (which shows Tuple[builtins.int]), it doesn't clearly indicate that the type is variable-length.
Note that with PEP 585 accepted, eventually we'll have to use builtins.tuple (or, I'd recomment, plain tuple) for both situations.
Activity
hauntsaninja commentedon Oct 2, 2020
It looks like mypy uses builtins.tuple as a homogenous tuple type:
mypy/mypy/typeanal.py
Line 290 in b884a39
Display ellipsis when formatting variadic `tuple[T, ...]` (#11857)
Display ellipsis when formatting variadic `tuple[T, ...]` (python#11857)