Closed
Description
Hello,
I would like to suggest adding an optional command line flag to disable type checking for _.
It is a Python idiom to use _ when the variable will not be used like this
for _ in range(10):
or when the return from a function is not needed, like this
a, b, _ = some_func()
Right now (mypy 0.501) I get this error
data_processing.py:993: error: Incompatible types in assignment (expression has
type List[List[str]], variable has type "str")
when running this
metadata_dic, _, _ = extract_data(data_lst)
because the return of the extract_data function is
Tuple[OrderedDict, List[List[str]], List[List[str]]]
and some code above that assignment also uses _, but it's type is str.
mypy alerts there is an incompatible type assignment, which would be correct it it was a common variable.
Best regards,
JM
Metadata
Metadata
Assignees
Labels
No labels