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
{{ message }}
Repository navigation
Language server not recognising True or False as builtins #3274
Extension version (available under the Extensions sidebar): 2018.10.0
OS and version: OSX
Python version (& distribution if applicable, e.g. Anaconda): python2.7 pyenv
Type of virtual environment used (N/A | venv | virtualenv | conda | ...): pyenv virtualenv
Language Server: Microsoft Python Language Server version 0.1.60.0 (from startup logs)
Actual behavior
False and True are now being marked as use before defined, suggesting they're no longer recognised as built ins.
Expected behavior
The poor booleans are not targeted as being issues.
Steps to reproduce:
See screenshot above.
Reacted by Gaëtan Lehmann, Chris Sattinger, Anthony McClosky, Kevin Orr, Anatoly Belonog, carolineld, Fernando Martin, Jojin , Hugo Defrance and Jordan Weaver
i have the same issue; even a simple test case like this triggers it:
ifTrue:
print"hi"
VS Code version: 1.28.2 and 1.29.0
Extension version (available under the Extensions sidebar): 2018.10.0
OS and version: OSX 10.14
Python version (& distribution if applicable, e.g. Anaconda): python 2.7.15 from homebrew
Type of virtual environment used (N/A | venv | virtualenv | conda | ...): N/A
Language Server: Microsoft Python Language Server version 0.1.60.0 (from startup logs)
Ok, I have been able to replicate this in my python 2.7 project.
When the project is first opened everything is fine. I notice that once the project has finished being analysed I see the underlining of True/False with use before def error.
I'm not sure if the warning is shown some time before analysis is completed though - as it takes about 10 minutes on my project and watching a single value for that long is tricky.
VS Code version: 1.26.1
Extension version: 2018.10.1
OS and version: Ubuntu Linux 17.10, 64-bit
Python version: 2.7.14 and 3.6.6
Language Server: Microsoft Python Language Server version 0.1.60.0
I have this issue as well, amongst other random/erroneous things that Python linter reports as being used before definition. (tuple built-in type for example)
This is an upstream issue with the language server. If you have issues with True/False beign reported as use-before-def, we'd appreciate it if you could report it in microsoft/python-language-server#391, or create a new issue if it's detecting something other than True/False as use-before-def.
I've been attempting to reproduce this for the past few weeks without any luck, so if you can make it happen consistently in some setup, I'd appreciate knowing (again, in the other repo's issue tracker).
Activity
DonJayamanne commentedon Nov 12, 2018
Interesting, I cannot replicate this at my end.
Are you able to replicate this consistently?
joelhock commentedon Nov 13, 2018
i have the same issue; even a simple test case like this triggers it:
VS Code version: 1.28.2 and 1.29.0
Extension version (available under the Extensions sidebar): 2018.10.0
OS and version: OSX 10.14
Python version (& distribution if applicable, e.g. Anaconda): python 2.7.15 from homebrew
Type of virtual environment used (N/A | venv | virtualenv | conda | ...): N/A
Language Server: Microsoft Python Language Server version 0.1.60.0 (from startup logs)
jakebailey commentedon Nov 13, 2018
I can make this happen on my machine, but only once, then it goes away for all files. I'll look into this upstream (and keep discussion there).
DonJayamanne commentedon Nov 14, 2018
This issue was moved to microsoft/python-language-server#394
jarshwah commentedon Nov 15, 2018
I can no longer replicate this issue within the same project for what it's worth.
jakebailey commentedon Nov 15, 2018
I can't either, unfortunately. Making it very hard to track down...
jarshwah commentedon Nov 18, 2018
Ok, I have been able to replicate this in my python 2.7 project.
When the project is first opened everything is fine. I notice that once the project has finished being analysed I see the underlining of True/False with use before def error.
I'm not sure if the warning is shown some time before analysis is completed though - as it takes about 10 minutes on my project and watching a single value for that long is tricky.
mikew commentedon Nov 19, 2018
Same here:
zbyszek-matuszewski commentedon Nov 22, 2018
I also see this problem.
VS Code version: 1.26.1
Extension version: 2018.10.1
OS and version: Ubuntu Linux 17.10, 64-bit
Python version: 2.7.14 and 3.6.6
Language Server: Microsoft Python Language Server version 0.1.60.0
crucialfelix commentedon Nov 26, 2018
I have had it consistently for many weeks.
Python Extension Pack 1.4.0 (includes Magic Python syntax highlighting)and ... just deactivated Python Extension Pack and the bug is gone. I think it was linter vs linter.EDIT: I spoke too soon. I have disabled Python Extension Pack but the selected language mode still shows as "Magic Python"
pylintis currently not enabled and I'm getting a dialog advising me to activate it.I still have many:
Visual Studio IntelliCode - Preview is on.
visualstudioexptteam.vscodeintellicode
Preview
No other python extensions enabled.
bennettandrews commentedon Nov 29, 2018
settings.json
Evanlec commentedon Dec 3, 2018
I have this issue as well, amongst other random/erroneous things that Python linter reports as being used before definition. (
tuplebuilt-in type for example)jakebailey commentedon Dec 3, 2018
This is an upstream issue with the language server. If you have issues with True/False beign reported as use-before-def, we'd appreciate it if you could report it in microsoft/python-language-server#391, or create a new issue if it's detecting something other than True/False as use-before-def.
I've been attempting to reproduce this for the past few weeks without any luck, so if you can make it happen consistently in some setup, I'd appreciate knowing (again, in the other repo's issue tracker).
brettcannon commentedon Jul 8, 2019
Fixed upstream.