-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
reveal_type(x) where x: Tuple[int, ...] doesn't show "..." #9522
Labels
Comments
hauntsaninja
pushed a commit
that referenced
this issue
Dec 29, 2021
Previously variadic tuples were displayed as `builtins.tuple[T]`, which is misleading. That syntax ordinarily indicates a tuple with a single element. This change adds the `...` ellipsis when formatting. The formatting of non-variadic tuples is unchanged (e.g. `Tuple[T, U]`). Fixes #9522
tushar-deepsource
pushed a commit
to DeepSourceCorp/mypy
that referenced
this issue
Jan 20, 2022
Previously variadic tuples were displayed as `builtins.tuple[T]`, which is misleading. That syntax ordinarily indicates a tuple with a single element. This change adds the `...` ellipsis when formatting. The formatting of non-variadic tuples is unchanged (e.g. `Tuple[T, U]`). Fixes python#9522
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Bug Report
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, plaintuple
) for both situations.To Reproduce
Expected Behavior
or
Actual Behavior
Your Environment
Master or 0.782, no flags.
The text was updated successfully, but these errors were encountered: