Closed
Description
The error message "Invalid tuple literal type" isn't very helpful if a user writes (int, str)
instead of Tuple[int, str]
.
Example:
from typing import List
def f():
# type: () -> (int, str) # Invalid tuple literal type
return (1, 'x')
A better message could be something like this:
program.py:3: error: Syntax error in type annotation
program.py:3:note: Suggestion: Use "Tuple[T1, ..., Tn]" instead of "(T1, ..., Tn)"
#4172 is closely related.