_From @darrickyee on November 9, 2018 15:30_
While typing a name, the Problems window raises "used before definition" warnings that do not go away when the name is completed.

The following actions do NOT fix this:
The only reliable way I have found so far to fix this is to restart VSCode.
Unlike https://github.com/Microsoft/vscode-python/issues/2290, this does NOT happen when jedi is enabled. This also does not appear to be a linter issue, as the (pylint) output does not show any of these warnings:

Can't seem to reproduce this with a toy example, but it is happening often enough in real projects that it is becoming a major usability issue. The number of "problems" explodes with phantom entries and makes the tool useless.
Don't show problems in Problems window if they don't exist.
Output for Python in the Output panel (View→Output, change the drop-down the upper-right of the Output panel to Python)
Starting Microsoft Python language server.
Microsoft Python Language Server version 0.1.60.0
Initializing for C:\Python37\python.exe
##########Linting Output - pylint##########
************* Module xml2data.elem.generic
40,4,convention,C0103:Attribute name "c" doesn't conform to snake_case naming style
------------------------------------------------------------------
Your code has been rated at 9.76/10 (previous run: 9.76/10, +0.00)
Output from Console under the Developer Tools panel (toggle Developer Tools on under Help)
_Copied from original issue: Microsoft/vscode-python#3277_
My team is seeing this issue on multiple MacOS machines and it's crushing our ability to use VS code for Python.
If you want to silence this message (until it's fixed), you can add this to your settings.json file:
"python.analysis.disabled": [
"use-before-def"
]
I had a typo in that snippet, should have said "analysis" spelled correctly. Oops.
With https://github.com/Microsoft/vscode-python/issues/3514 causing Jedi to effectively fork-bomb our systems, and this issue preventing us from turning off Jedi, we're stuck between a rock and a hard place. Is the core team able to reproduce?
I tried for a few weeks to reproduce this and #391, without avail. If you have some reproducing case that's publicly available, I'd love to have it.
Otherwise, you can disable all of the warnings the language server produces in your settings.json:
"python.analysis.disabled": [
"use-before-def",
"unresolved-import"
]
And continue to use pylint/flake8/pep8 (which the extension continues to support).
With the ongoing analysis simplification, all of the code which produces these diagnostics will be removed and rewritten completely, so I would expect to see this sort of issue go away as well.
Also be aware of Brett's comment (https://github.com/Microsoft/vscode-python/issues/3514#issuecomment-444686905) which states that the Jedi version may simply be rolled back for the upcoming release, but I'm not personally involved in that sort of thing.
Also having this issue, I was able to reproduce it as per my comment on the original issue https://github.com/Microsoft/vscode-python/issues/3277#issuecomment-448478448
Also having this issue. It also happens in rust and c++ too.. although infrequently
Python screenshot:

C++ Screenshot:

PS: I posted the C++ screenshot to suggest that the issue might not be in python language server, but in vscode itself.
The fix helped in #386 (comment)
Thank you 🙏
Do I need to remove the ignore when this issue is fixed be it in the LS or in vscode itself?
Yes, if you'd like to see the message show up. We plan to reimplement this specific message (use-before-def) for the new LS, but other items have taken priority.
Thanks 🙏 No hurry on this. I didn't miss it that much previously.
Since I've now subscribed to the issue, I'll do so when this is solved. Really thank you for closing my original issue with this fix.
Should be gone in 0.2
Most helpful comment
If you want to silence this message (until it's fixed), you can add this to your settings.json file: