Intellisense for a module fails in the conditional block when same module used in the if-statement (works for if-not)
See original GitHub issueFrom @bgse on July 17, 2017 12:6
Environment data
VS Code version: 1.14.1 (issue also present in 1.13.x) Python Extension version: 0.6.7 Python Version: 2.7.12 OS and version: Ubuntu 16.04
Actual behavior
Intellisense for a specific module (and only this module) fails in the conditional block after the module is used in if-statement, does work for example after module is used in if-not-statement.
Expected behavior
The intellisense for the specific module should not break down depending on how it is used in a conditional statement.
Steps to reproduce:
Try the following example code, see intellisense is broken for the ‘fails’ cases, and is working for the ‘works’ cases.
import os
import sys
if not os.path.isfile('test.txt'):
works = os.path.isfile('test.txt')
if os.path.isfile('test.txt'):
fails = os.path.isfile('test.txt')
works = sys.version_info
fails = os.path.isfile('test.txt')
if sys.version_info is not None:
works = sys.version_info
if os.path.isfile('test.txt') is True:
fails = os.path.isfile('test.txt')
if os.path.isfile('test.txt') is not False:
fails = os.path.isfile('test.txt')
if os.path.isfile('test.txt') is not True:
works = os.path.isfile('test.txt')
if os.path.isfile('test.txt') is False:
works = os.path.isfile('test.txt')
if os.path.isfile('test.txt') is not None:
works = os.path.isfile('test.txt')
if os.path.isfile('test.txt') is None:
fails = os.path.isfile('test.txt')
while os.path.isfile('test.txt'):
works = os.path.isfile('test.txt')
while os.path.isfile('test.txt') is True:
works = os.path.isfile('test.txt')
while os.path.isfile('test.txt') is not True:
works = os.path.isfile('test.txt')
Copied from original issue: DonJayamanne/pythonVSCode#1090
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Using If...Then...Else statements (VBA) - Microsoft Learn
Use an If...Then...Else statement to define two blocks of executable statements: one block runs if the condition is True, and the other block ......
Read more >VBA IF (IF Then Else Statement) - Excel Champs
In the above statement, we have written an IF statement to evaluate if cell A1 has a value of 10 then it will...
Read more >Working with Rules - ESLint - Pluggable JavaScript Linter
When linting text, it returns the value passed to —stdin-filename or <text> if not specified. getScope() - returns the scope of the currently-traversed...
Read more >VBA If, ElseIf, Else (Ultimate Guide to If Statements)
VBA Public Variable – Use a Variable in Multiple Modules or Subs ... Here is the syntax for a simple one-line If statement:....
Read more >Terraform tips & tricks: loops, if-statements, and gotchas
You can find working sample code for the examples in this blog post in the ... As of Terraform 0.13, the count parameter...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This works in VS engine
Fixed thanks to the Jedi 0.12.0 upgrade.