You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
Fixes#16468
The fix is straightforward.
Btw when fixing this I noticed that we disregard type arguments when
narrowing, for example:
```python
x: Sequence[int]
if isinstance(x, tuple):
reveal_type(x) # tuple[Any, ...], but should be `tuple[int, ...]`
```
I guess fixing this may be tricky, and it is quite old behavior.
Fixes#16468
The fix is straightforward.
Btw when fixing this I noticed that we disregard type arguments when
narrowing, for example:
```python
x: Sequence[int]
if isinstance(x, tuple):
reveal_type(x) # tuple[Any, ...], but should be `tuple[int, ...]`
```
I guess fixing this may be tricky, and it is quite old behavior.
To Reproduce
Expected Behavior
Type-checks fine.
Actual Behavior
Your Environment
mypy.ini
(and other config files): noneThe text was updated successfully, but these errors were encountered: