In the following code, both a and b are outputs of generator functions, and could evaluate to None or have a value.
def testBehaviour(self):
a = None
b = 5
while True:
if not a or not b:
continue
print('blaat')
If I put breakpoints (using Visual Studio Code) on the line with the continue statement, and the line with the print statement, neither is hit. The print statement is not called, and the loop just keeps running indefinitely as expected, but I would expect that breakpoints are hit.
If I change the code to one of the following:
def testBehaviour(self):
a = None
b = 5
while True:
if not a:
continue
print('blaat')
or:
def testBehaviour(self):
a = None
b = 5
while True:
if not a or not b:
c = 'dummy'
continue
print('blaat')
And again place breakpoints on the lines with the continue and print statements, the breakpoints are hit.
Can anyone tell me why the breakpoints are not hit? It seems to not happen only in Visual Studio Code, because our code-coverage tool also states that the continue statement was not called.
This is on python 2.7 on Windows 7, 32 bit.