-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Enable warn_unreachable = True for mypyc
and all other files as well
#19050
New issue
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
base: master
Are you sure you want to change the base?
Enable warn_unreachable = True for mypyc
and all other files as well
#19050
Conversation
I am now waiting on mypyc/mypyc#1101 to be resolved to finish this issue, after which I will have to rebase this branch onto master to get the resolution. |
This comment has been minimized.
This comment has been minimized.
Wow, only one hit? That should be easy to resolve... |
@stanislavlevin, yep! Only one hit for this project 🥳! Unfortunately (so to speak), deciding what to do about that is best left to people more familiar with mypyc than me. I could simply comment out this code, which I might do eventually, but if someone with a better idea about what it should do comes along, I will defer to them. |
Supplements #19050. The old version did certainly contain unreachable code, as otherwise that branch would have crashed, there is no `type_args` attribute. This block was introduced in #17027 - probably as a future-proof expansion to generic primitive operations, but it makes no sense now, this logic can be added back should it become necessary.
This comment has been minimized.
This comment has been minimized.
Hmm, another hit. I guess it was masked or subsequently developed or something... |
Even after installing python 3.9 I can't reproduce this. Odd. I'll try merging again once another commit hits master, in case this was a fluke. |
FWIW, I can reproduce this locally in a fresh 3.9 venv: $ python --version
Python 3.9.23
$ python -m mypy --config-file mypy_self_check.ini misc --exclude misc/sync-typeshed.py
misc/analyze_cache.py:44: error: Statement is unreachable [unreachable]
elif isinstance(chunk, list):
^
misc/analyze_cache.py:44: note: See https://mypy.rtfd.io/en/stable/_refs.html#code-unreachable for more info
misc/analyze_cache.py:96: error: Statement is unreachable [unreachable]
return chunk
^~~~~~~~~~~~
misc/analyze_cache.py:127: error: Statement is unreachable [unreachable]
return chunk
^~~~~~~~~~~~
Found 3 errors in 1 file (checked 17 source files)
quick git tip: you can also tickle the CI by pushing an empty commit with |
According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅ |
Achieves a todo, enabling warn_unreachable = True for
mypyc
and all other files as well