We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Bug Report
Getting a false negative on tuple indices and lengths.
To Reproduce
from typing import Tuple, Union def zxc(x: Union[Tuple[str], Tuple[str, int]]) -> None: if len(x) == 1: print(x[0]) elif len(x) == 2: print(x[0], x[1]) # line 7
mypy mypytest.py
Expected Behavior
Expected mypy to pass. As far as I can tell, the types are correct.
Actual Behavior
Mypy fails with:
mypytest.py:7: error: Tuple index out of range Found 1 error in 1 file (checked 1 source file)
Your Environment
mypy.ini
The text was updated successfully, but these errors were encountered:
Duplicate of #9171 , #1178 and others (also this is a false positive :-) )
Sorry, something went wrong.
No branches or pull requests
Bug Report
Getting a false negative on tuple indices and lengths.
To Reproduce
Expected Behavior
Expected mypy to pass. As far as I can tell, the types are correct.
Actual Behavior
Mypy fails with:
Your Environment
mypy.ini
(and other config files): NoneThe text was updated successfully, but these errors were encountered: