对于遇到这个 Stack Overflow 问题的任何人想知道如何禁用 Pylance 将其(通常错误地)认为无法访问的文本变灰的功能,解决方案由 luabud 在这 条评论 和关于GitHub issue How to disable “code is not reachable”… ,就是在你的用户/工作区 settings.json 文件中加入以下条目: "[python]": { "editor.showUnuse...
The Python warning that code is unreachable occurs when you return a value from a function and try to run more code after the function has returned.
I have python installed and I have pythonPath set, but whenever I open a python project folder I get this popup I get the poput even though I already opened this project previously in VSCode. And even more weird is that I just had a proj...
~/.vscode/extensions/ms-python.python-2019.8.29288/pythonFiles > /usr/bin/python3 -m pylint --disable=all --enable=F,unreachable,duplicate-key,unnecessary-semicolon,global-variable-not-assigned,unused-variable,unused-wildcard-import,binary-op-exception,bad-format-string,anomalous-backslash-in-strin...
I am very tempted to drop this idea. In my own code I use this: JsonDict = Dict[str, Any] which happens to cover perfectly what I'm doing (even though it sounds like Jukka has found some holes :-). That really doesn't reach the threshold for adding it to a stub file to me ...