-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed
Labels
bugmypy got something wrongmypy got something wrong
Description
To Reproduce
from typing import Union, Sequence
def f(pad_width: Union[int, Sequence[int]],) -> None:
if (isinstance(pad_width, tuple)
and len(pad_width) == 2
and isinstance(pad_width[0], int)
and isinstance(pad_width[1], int)
):
passExpected Behavior
Type-checks fine.
Actual Behavior
mypy-bug.py:8: error: Value of type Never is not indexable [index]
mypy-bug.py:9: error: Value of type Never is not indexable [index]
Found 2 errors in 1 file (checked 1 source file)
Your Environment
- Mypy version used: 1.7.0
- Mypy command-line flags: none
- Mypy configuration options from
mypy.ini(and other config files): none - Python version used: 3.12
Metadata
Metadata
Assignees
Labels
bugmypy got something wrongmypy got something wrong